Transcript
Page 1: CS120 Fall 2019 Lab 9 – Week of November 17th ARDUINO TIME

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