28
MIT Entrepreneurship and Maker Skills Integrator Hacking with Arduino January 2018 Elaine Chen

MEMSI January 2018: Arduino 101

Embed Size (px)

Citation preview

Page 1: MEMSI January 2018: Arduino 101

MIT Entrepreneurship and Maker Skills Integrator

Hacking with ArduinoJanuary 2018Elaine Chen

Page 2: MEMSI January 2018: Arduino 101

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

Page 3: MEMSI January 2018: Arduino 101

Exercise 1: Hooking up the Arduino board

3

Page 4: MEMSI January 2018: Arduino 101
Page 5: MEMSI January 2018: Arduino 101
Page 6: MEMSI January 2018: Arduino 101
Page 7: MEMSI January 2018: Arduino 101

Anditblinks!

Page 8: MEMSI January 2018: Arduino 101

Runsonce

Page 9: MEMSI January 2018: Arduino 101

Runsoverandoveragainforever

Page 10: MEMSI January 2018: Arduino 101

Whatdoesthisdo?

Page 11: MEMSI January 2018: Arduino 101

Thesearecalled“pins”

Page 12: MEMSI January 2018: Arduino 101

Thisiscalleda“pinoutdiagram”

Page 13: MEMSI January 2018: Arduino 101

LED_BUILTINcorrespondstoPIN13

Page 14: MEMSI January 2018: Arduino 101

Inputversusoutput

Page 15: MEMSI January 2018: Arduino 101

PIN13controlsthisLED

Page 16: MEMSI January 2018: Arduino 101

Foroutput:HIGH=ONLOW=OFF

Page 17: MEMSI January 2018: Arduino 101

delay(xxx)=Waitxxxmilliseconds

Page 18: MEMSI January 2018: Arduino 101

Wearetellingtheon-boardLEDtoturnonfor1000ms,offfor1000ms

Page 19: MEMSI January 2018: Arduino 101

Exercise 2: Change how fast the on-board LED blinks

19

Page 20: MEMSI January 2018: Arduino 101

Changethis

Page 21: MEMSI January 2018: Arduino 101

Anditblinksdifferently!

Page 22: MEMSI January 2018: Arduino 101

Exercise 3: Control an external LED

22

Page 23: MEMSI January 2018: Arduino 101
Page 24: MEMSI January 2018: Arduino 101

Anditblinkshere,too!

Page 25: MEMSI January 2018: Arduino 101

Exercise 4: Read a knob(AnalogReadSerial example –

with Serial Monitor)

25

Page 26: MEMSI January 2018: Arduino 101
Page 27: MEMSI January 2018: Arduino 101

Exercise 5: Control the brightness of an LED with the knob (AnalogInOutSerial example)

27

Page 28: MEMSI January 2018: Arduino 101

Questions?