Expand on RGB LED dimmer code by allowing for advanced serial communication, and add a diffuser to blend RGB LED colors. My code allows you to control each LED in 20% brightness increments, with R using "1-6", G using "q-y", and B using "a-h". I did this because as a designer, I'm used to picking colors by hue, saturation, and brightness (HSB), but specify the colors in RGB for a developer to use. This interface allows for a way to understand how RGB color mixing works. The diffuser I used was a plastic bottle stopper.
For my first diffuser, I tried using multiple disposable tea bags (the type for loose leaf tea). However, the individual LEDs could still be seen clearly through the bags. For my final diffuser, I placed a disposable tea bag inside an origami inflatable ball. This seemed to work much better.
I originally parametrically designed a diffuser to be laser cutted in acrylic, but I had some problems with the access to the CAD/CAM lab at the CED. I did an alternative diffuser by folding paper.
-Code:
Description
created a diffuser with a plastic cup, some wax paper, and pillow stuffing. Additionally, i modified the serial controlled LED example code to allow for 'r', 'g', or 'b' key strokes to control the brightness of the respective LED.
Components Used
arduino uno
(3) 220 kohm resistors
1 red, green, blue LED
diffuser: 1 plastic cup, wax paper, stuffing
My first design was a piece of styrofoam as a top for the 3 LEDs, but this was not a very stable as the styrofoam could easily fly off when it is windy. My second and final design consists of a ping-pong ball. I cut out the bottom and lined the inside with cotton to help soften and even out the light. The result is a much cleaner and protective design that is more resistant to the elements (air, water).
Materials Used:
Ping Pong Ball
Cotton Padding
Homework 2
Description
Using three LED make all the colors of the rainbow by fading each of the Red Green and Blue lights at different rates.
I adjusted the rate of change to 10 so that I could achieve faster fades.
Code
/*
* Code for cross-fading 3 LEDs, red, green and blue, or one tri-color LED, using PWM
* The program cross-fades slowly from red to green, green to blue, and blue to red