Posts

Showing posts from May, 2009

RGB LED

Image
Yet another bit of fun that came with my last order to SparkFun were 10 (?) RGB LEDs. These are clear and have four leads coming off of them. They are - shortest to longest: blue, green, ground, and red.  The blue and green take 3.3v, the red takes 2v. Again, the Arduino gives us 5v on most of it's digital pins. There is a 3.3v pin, but I think that's always on. But the Arduino also makes 6 of the pin capable of PWM or Pulse Width Modulation . This is the ability to pulse that 5v on and off at certain intervals and simulate different voltages. Click the link if you want to know more. Anyway, I set up the proto-shield using PWM and some 100 ohm resistors. While I still haven't bothered to actually calculate the proper resistance, I felt fairly certain I wasn't going to wreck the LED.  My first bit of code just flipped through the 8 different combinations of colors: off, red, green, blue, yellow (red/green), aqua (green/blue), purple (red/blue), and white (all 3).  /* * R