a. light up an LED
b. light up a RGB LED and use it's three colors
c. get information about what's happening in your arduino through the serial monitor
Of course, lighting up an LED is easy. There's the blink tutorial on how to blink an LED, but I modified it a little bit and jumped to lighting up your RBG LED and get the status of the Arduino through the serial monitor. Well, the arduino won't really tell you anything, but we'll tell it what to tell to us about what we told it to do. Basically, tell us what is the current color of the RBG LED.
This should help you:
a. be able to create status messages on your arduino to be view on the serial monitor so that you know what's happening
b. help you understand why sometimes we need to know what's happening
In this instructable, all you need is available in your Arduino Starter kit from Sparkfun.com. But here's a list:
1. RBG LED
2. 4 wires, preferably 1 black, 1 red, 1 blue, and 1 green
3. a 10kOhm resistor (optional)
4. an Arduino board, the one I used is the Arduino Duemilanove board with ATMEGA328
5. breadboard, or similar
Step 1: Wiring
I've added a 10kOhm resistor so that I can dim the LED a little bit because without that, the LED shines really bright. I mean, REALLY bright. Although, if you choose not to put a resistor, that's fine. It will still work.
Step 2: Code and Serial Monitor
The code is attached, but you can copy paste it from this page www.zeighy.net/site-files/content/public/RBGSERIAL.html
Step 3: Final Remarks
Where do you go from here:
- you can now use other sensors and you can display status using the serial monitor. Check the reference on the Arduino website on how to display values form sensors
- build your own circuit and get status messages from the arduino so that you know what's happening and to know of something is going wrong.
- you might probably want to try out other methods you can use information you get from the serial connection.
Here's a sample run of mine: