linear1 forums
[part of the linear1 network]
+ [linear1 case mods]
+ [LED Center]
+ [privacy policy]
Welcome, Guest. Please login or register.
March 21, 2010, 07:13:56 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Login Register

linear1 forums  |  LED discussion  |  Microcontroller madness  |  Topic: Solid color changing algorithms « previous next »
Pages: [1] Print
Author Topic: Solid color changing algorithms  (Read 358 times)
Rhaikh
Smart like tractor
**
Offline Offline

Posts: 38


« on: December 10, 2007, 08:13:59 PM »

Hey guys, it's been awhile.

After many months of dust collection, my project (Web-controlled rgb LED room lighting) is nearing completion!

I'm at the stage where I am dreaming up little programs to run on this thing to interpolate between colors, or strobe different colors in succession.  I was wondering if anyone here has some ideas for me to implement.

I can only control the RGB channels, not individual LEDs (they are being diffused anyway).  They are physically checkerboarded, but there are two channels of Red and three each of Green and Blue that I can control individually.  They are PWMed with 8 bit resolution (0 to 255, like HTML color).  It is potentially possible for me to add sound as a control input, but I wouldn't know what to do with it.  But basically, I'm wondering if there are any cool sequences that you guys have seen before.

So far I'm considering
1) X to Y color interpolation over n time
Can Implement with this:
  A) Color X to Y to Z to X repeat
  B) A, but with more/fewer/random/patterned colors
  C) Make one color "off" and do color pulsing

2) Color Strobing with f frequency and d duration
  A)  Random/set color patterns

Any other suggestions?  Yes I will post pics when it's done Smiley
« Last Edit: December 10, 2007, 08:47:47 PM by Rhaikh » Logged
minimum
Smart like tractor
***
Offline Offline

Posts: 132

LED fanatic


« Reply #1 on: December 11, 2007, 12:47:09 AM »

Do you have more than one RGB channel? If yes, then you could do "waves" : X to Y color in chan. A , same in chan. B but shifted.
"Pulse" - some random static color X , then color Y kicks (smoothly) in for a second or less.
Limited color interpolation - the shift in color is very little but noticeable in favorite shade.

Oh, and be sure to take lots of pictures/videos and share it Smiley
Logged
Rhaikh
Smart like tractor
**
Offline Offline

Posts: 38


« Reply #2 on: December 11, 2007, 04:38:48 PM »

Do you have more than one RGB channel? If yes, then you could do "waves" : X to Y color in chan. A , same in chan. B but shifted.
"Pulse" - some random static color X , then color Y kicks (smoothly) in for a second or less.
Limited color interpolation - the shift in color is very little but noticeable in favorite shade.

Oh, and be sure to take lots of pictures/videos and share it Smiley

Ah, I was thinking pulse from off to on for one color, but the static color and swift change to another sounds like a cool idea too.  Thanks!
Logged
jlforester
Smart like tractor
**
Offline Offline

Posts: 30


« Reply #3 on: December 12, 2007, 07:24:46 PM »

If you're looking for lighting effects, here's a few effects I put into my color-changing landscape lights:

(I'm assuming that if you have multiple lighting fixtures, they are individually controllable)

Fireflies:  Set all lights to the same base color (red, green, blue, or black).  Pick a light at random, and set it to white, then immediately have it fade back to the base color.  Delay for a brief random period and repeat.

Color ramp:  Gradual cross-fade from red to green to blue back to red.  All lights the same color.  Easy to do.  Fade up red, fade up green, fade down red, fade up blue, fade down green, fade up red, fade down blue...repeat forever

Twinkle:  Select random light.  Set color to white.  Delay briefly (I use 1/100 sec), set color to random color.  Repeat forever.

Rainbow fireflies:  Set all lights to black.  Pick random light.  Set to a color.  Fade to black.  Wait random brief time, and repeat.

The firefly effects work best if you can tell your lights to do the fade.  Then you don't have to wait for a light to complete its fade before you can do another light. If your lights can only change to a set color, then you have to manage the effect yourself.

Most of my lighting effects make use of color palettes.  What that means is that an effect can use a select set of colors.  I have a "Christmas" palette that consists of just red and green.  So if I tell the rainbow fireflies effect to use the Christmas palette, it will only use the red and green colors.  I have a rainbow palette of about 10 colors from red to purple, and some other different palettes.
Logged
Rhaikh
Smart like tractor
**
Offline Offline

Posts: 38


« Reply #4 on: December 13, 2007, 02:44:41 PM »

That's totally awesome.  Doesn't mesh too well with my project (only one huge bright fixture), but it sounds really cool.  My project is expandable and would then be individually controlled though, so maybe one day.  Some of those patterns might work well, I'll give them a try!

Thanks.
Logged
Pages: [1] Print 
linear1 forums  |  LED discussion  |  Microcontroller madness  |  Topic: Solid color changing algorithms « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.161 seconds with 17 queries.