CS120 Fall 2019 Lab 9 – Week of November 17th ARDUINO TIME
Post on 08-May-2022
3 Views
Preview:
Transcript
CS120Fall2019Lab9–WeekofNovember17thARDUINOTIME
JustalittlebitoffunwiththeArduino.It’sjustwiresandelectricity.Don’tletitfreakyouout!1)Open“file/examples/basics/blink”–thisisasmallsampleprogram.2)Clickthe“upload”button–thisisanarrowtotheright3)Ifeverythingissetupcorrectly,you’llseetheLEDsontheArduinoflickerforamoment,andthentherewillbeasingleLEDthatblinksonandoff.TheTAhasbreadboards,LEDs,wires,andresistors.
Onthebreadboard,thelongverticalstripesontheleftandright(withtheblueandred)areconnected–theyarenormallyusedforpowerandground.Inthemiddle,thelefthorizontalgroupoffiveholesareconnected,asaretheright.
AnLEDwilllightupwhenthelongerleghaspower(5volts),andtheshorterlegisconnectedtoground(abbreviatedGND).TokeeptheLEDfromusingtoomuchpower,connectthenegativepinoftheLEDtogroundusinga1kohmresistor(stripesarebrown/black/red).
TryconnectingupanLEDtopowerandgroundfromtheArduino–makesureitturnson.Then,connectittopin13ontheboard–itshouldblinkinthesamewayastheLEDembeddedontheArduino.Andnow…Moveittoconnecttopin12,andhavethemalternateonandoff….
AddsomemoreLEDs,usingotherpinsfromtheArduino.Canyoubouncethelightsbackandforth?Getthemtocount?
Onceyou’vegotthatgoing….Therearesomespeakers.CheckouttheToneMelodysketch.
top related