cs120 fall 2019 lab 9 – week of november 17th arduino time
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.