Home‎ > ‎Unit 06‎ > ‎

Add More LEDs

Lets control some LEDs other than the ones built into the Arduino. So Far we've only controlled the LED built into our Board. Open one of the Programs you wrote to control the LED on the board. Build the circuit below and run your program. You should see the LED on your breadboard flashing along with the LED on your Arduino.

Now change the value of your ledPin variable to some other number. YOU SHOULD AVOID PINS 0 AND 1. These are the pins that Firmata and Processing use to communicate. Move your wire the the appropriate pin numer to match your new ledPin and re-run your program. You should notice that the LED on your breadboard works, but the one on your Arduino stays off now.

Controlling one LED is cool at first, but gets pretty boring. Next build this circuit:

Assignment 6.4 - Write a program in Processing to light up each LED one after the other. Note you'll need a different arduino.pinMode(13,Arduino.OUTPUT); for each pin you're using. You may also want to use a for loop. Once it goes one way make it go there and back again.

Assignment 6.5 - Write a program that will not light up anything my itself. Instead it will light up the first LED if I press "1", the second if I press "2" and so on.

Assignment 6.6 - Write a program that uses your LEDs and does something interesting with User Input.