Upload
elaine-chen
View
16
Download
3
Embed Size (px)
Citation preview
MIT Entrepreneurship and Maker Skills Integrator
Hacking with ArduinoJanuary 2018Elaine Chen
What we are going to do• Exercise 1: Hooking up the Arduino board • Exercise 2: Change how fast the on-board LED blinks• Exercise 3: Control an external LED • Exercise 4: Read a knob • Exercise 5: Control the brightness of an LED with the
knob
2
Exercise 1: Hooking up the Arduino board
3
Anditblinks!
Runsonce
Runsoverandoveragainforever
Whatdoesthisdo?
Thesearecalled“pins”
Thisiscalleda“pinoutdiagram”
LED_BUILTINcorrespondstoPIN13
Inputversusoutput
PIN13controlsthisLED
Foroutput:HIGH=ONLOW=OFF
delay(xxx)=Waitxxxmilliseconds
Wearetellingtheon-boardLEDtoturnonfor1000ms,offfor1000ms
Exercise 2: Change how fast the on-board LED blinks
19
Changethis
Anditblinksdifferently!
Exercise 3: Control an external LED
22
Anditblinkshere,too!
Exercise 4: Read a knob(AnalogReadSerial example –
with Serial Monitor)
25
Exercise 5: Control the brightness of an LED with the knob (AnalogInOutSerial example)
27
Questions?