Mood light
I wanted to build this for o long time... and today I finally had the "mood" and the time to do it... it's a mood light created with a tricolor led and a laptop with a parallel port.
I did this to see what is required to create a mood light, because the plan is to create one with a pic microcontroller and use it as a digital candle.
Here is the youtube movie with it :
As you can see I created a paper cube and inserted the led into it to have a diffuse light, or else the 3 basic colorsĀ will appear as 3 red circles, and we don't want that.
Here are some pictures too :
And if you are interested in building the paper cube here is the plan (print on an A4 sheet of paper) :
If you are interested here is some theory :
Each color is build using 3 base colors : red, green and blue, the led has 4 pins, a comon one and one for each color, so you can individualy turn on and off each color, so we will use 4 pins from the paralel port.
In my program (which is not yet optimized) each component (rgb) can have a value between 0 and 255, to do this we have a huge while cycle where we show the colors, here is a diagram to make it easier.
So from diagram is pretty clear, based on each color value we show that color an amount of time, as bigger the value, more the time and brighter the color, a resolution of 255 values for each color is more then enough for this case.
There are more things in the program, for example you can increase or decrease the value for each color using the keyboard to see how diferent colors look like.
Also from the setR, setG, setB functions you can customize what to do for each color, in case you use diferent pins i used pin0: red, pin1:common, pin2: blue, pin3: green, feel free to use any other combination but remember to change those functions.
Any questions are welcome.
Related posts:






July 15th, 2010 at 8:30 pm
Buy:Zetia.Buspar.Acomplia.Ventolin.Wellbutrin SR.Lasix.Prozac.Advair.Seroquel.Lipothin.Female Cialis.Cozaar.Female Pink Viagra.Aricept.Benicar.Amoxicillin.Nymphomax.SleepWell.Lipitor.Zocor….