8General RulesRaise your hand if you have a question. Be respectful. When I raise my hand… Share your findings with the people near you. Poke around, experiment, and have fun… Imagine, create, and play!!!
9ObjectivesProvide a thorough introduction to the Arduino programming environment. Develop a use of simple functions to interact with the LEDs, light sensor, push button, and buzzer on the Protosnap Pro Mini.
11Arduino LilyPad Protosnap Dev What is it? What can it do? Who cares?
12What is it?Heart of it – ATMega328 (a $4 microcontroller) Open Source High tolerance for ESD and “bad” electronics practices… Provides easy way to interact with a computer physically – a.k.a. physical computing
13What can it do? Great for prototyping ideas Great to teach Intro to Programming Arduino (no assembly required!)Lots and lots of options!Large pads can be sew- able
16Components, Silk Screen & Pins 16Components, Silk Screen & PinsWhat is all this???Vibe Motorthe BrainATmega328RGB LEDTemp.SensorSwitch / ButtonSuper important. Ask people to identify what sensor is connected to what pin later on.Light SensorLight Emitting Diodes (LED)Buzzer / Speaker
26Understanding Input vs. Output 26Understanding Input vs. OutputReferenced from the perspective of the microcontroller (electrical board).Inputs is a signal / information going into the board.Output is any signal exiting the board.Almost all systems that use physical computing will have some form of outputWhat are some examples of Outputs?
27Startup Arduino IDEDouble-click on either the Arduino Icon or wherever you installed (saved) the Arduino program.
28Plug it in Plug it in. FTDI is Serial buffer, 5V, GND, reset. 28Plug it inPlug it in. FTDI is Serial buffer, 5V, GND, reset.40-50 miliAmps source3.3V system. 9 pins broken out. PWM and analogs. You can reconfigure analog ins to be outputs.
29Lesson #0 – Configuring Arduino Setup Board(LilyPad Arduino w/ ATmega328)Setup COM PortPC – Highest COM #Mac – /dev/tty.usbserial-A####xXx
30Settings: Tools Board 30Talk about different board types
31Settings: Tools Serial Port 31Talk about different board types
32Other Board Types32Arduino Fio – Programmed using Funnel (ActionScript, Processing, Ruby)LilyPad 328 Main BoardArduino MegaMega Mini 3.3Arduino Mini Pro 3.3Arduino Uno Compatible -- Redboard
43Save your Project Save early, Save often! Enumerate your iterations – (e.g. blink_10.adp, blink_11.adp, blink_12.adp…)
44Concept: Analog vs. Digital Microcontrollers are digital devices – ON or OFF. An Analog signal is anything that can be a full range of values. What are some examples? Think of like a ramp or a hill.
45Concept: Analog vs. Digital To create an analog signal, the microcontroller uses a technique called PWM.Pins 3, 5, 6, 9, 10, 11 are capable of producing an Analog OutputPulse Width Modulation (PWM)
46Color Mixing with 3 LEDs analogWrite() Challenge 2a:How do you turn on the RED LED?Experiment with different values – what do you observe happens?How do you turn on the GREEN or the BLUE LED?
47Color Mixing with 3 LEDs Tri-color LED The RGB LED is a Common- Anode (means the positive side of the LED is all tied to Vcc). The signal line is connected to the bottom of each LED. Don’t worry - it’s just a different method of completing a circuit!5 VPin9Pin11Pin 10
48Color Mixing with 3 LEDs analogWrite() Challenge 2b: Experiment with different values of Red, Green, and Blue to create a couple different colors. Write down the values you used. Check these values with Challenge 2c: Create a unique lighting display that integrates a blink, fade, or a switching of colors. Be prepared to have a name for your art piece and show this to the rest of the class.
54digital Inputs Buttons / Slide Switches 54digital Inputs Buttons / Slide SwitchesSame as Pin A5Challenge 3a:Re-arrange the blocks or add new ones to:Turn ON an LED when the button is pressed.Otherwise blink continuously…
55digital Inputs Buttons / Slide Switches 55digital Inputs Buttons / Slide SwitchesChallenge 3b:Now, using the button / switch – to start a disco/light changing patternChallenge 3c:Now, using the button / switch – to turn on and off the VIBE motor.
63Making Music Let’s Play a song… Twinkle-Twinkle:CC GG AA G FF EE DD C GGHappy Birthday:G G A G C B G G A G D C G G G E C C B A Hot Cross Buns:B A G <> B A G <> G G G G <> A A A A B A GMary Had A Little Lamb:B A G A BB B <> AA A <> BB B <>B A G A BBBB AAA BAG.
64Musical Notes / Frequencies Frequency (Hz)C4261C#4/Db4277D4293D#4/Eb4311E4329F4349F#4/Gb4369G4392G#4/Ab4415A4440A#4/Bb4466B4493Note Frequency (Hz)C5523C#5/Db5554D5587D#5/Eb5622E5659F5698F#5/Gb5739G5783G#5/Ab5830A5880A#5/Bb5932B5987