RGB LED experiment Arduino

  
Inside:
Repository
This evening as I came home from a paragliding appointment, I had a feeling that I must improve my yesterday-written RGB LED driver code. So I cleaned it up a bit, and wrote a lot of comments to make it more useful for educational purposes. I`m alredy over this level, but it`s fun to play with it. An RGB LED is just three LEDs in a single package:
RGB LED experiment Arduino - schematic

red, green and blue, from here comes the TLA. If you have no RGB LEDs currently, you can replace it with a red, a green and a blue LED. For a good result, the LEDs` (visible) brightnesses have to be similar. The idea is, that from the three basic  colors (r, g, b) a lot of colors (but not all) can be mixed. This mixing is performed by three individual PWM signal applied by the AVR controller on the Arduino board. See more about PWM at. I think the whole thing is very simple, but it looks nice, and you can experiment with the generation of different waveforms. Try to modify the code to use a harmonic (sine) function as input for the lightness. For more advanced users: avoid the built-in sin() function, but produce sinusoidal output. Hint: arrays This video may not be as exciting as the previous one (see here ) because my phone`s camera is unable to capture the fine changes in the color of the LED. It seems much more better in reality, so you really must build one. The other side of the breadboard (and the rest of the parts)is used in another project and it`s not connected to the board now. I was just too lazy to disassemble it. This doesn`t need explanation. Just connect your RGB LED to the Arduino board in series with three 560 © resistors as you can see on the figure above. (200 © is fine too these resistors define the current which flows through the LEDs. The current cannot exceed 50mA (each), as it could damage the...



Leave Comment

characters left:

New Circuits

.