Question about programming the WS2811 RGB LED.
NWCCTV
Posts: 3,629
So I was showing off the WS2811's that I picked up from Pololu (http://www.pololu.com/product/2536) to my grandson. When I explained to him that they could be programmed to display up to 256 million colors he says to me " so make them do all of them"!!!! This got me to thinking, is there a way to have 6 of these LED's advance to the next color after a few seconds? I know there would be a limit but what is that limit and how would I program them to do this. This can be my End of Year, Start of Year project just for him!!!!
Comments
Sorry to disappoint you but there aren't 256 million colors. There are only 16,777,216. That's if you count all off as a color.
You could certainly start a loop with a variable incrementing by one and send the variable to the WS2812 driver to be displayed. This is incredibly boring. If you scrolled through ten colors a second it would take 19 days to get through all the colors. And when the colors are displayed with just an incrementing number, it's very uninteresting to watch (guess how I know).
Try something fun like my hypno rings code (MirrorWheels in post #2 of the following thread).
http://forums.parallax.com/showthread.php/149822-Fun-With-NeoPixels
I wrote the "MergeColors" method to make it easier to display sections of the rainbow. There are a variety of other rainbow type demos available. I'm sure I could help you with a simple demo if you don't find one you like. How many LEDs do you have?
http://obex.parallax.com/object/703
but here is Peter's interactive Tachyon code for the WS2811
http://forums.parallax.com/showthread.php/157792-Interactively-test-WS2812-NeoPixel-LEDs-with-Tachyon-and-serial-terminal-Matrix-demo?highlight=ws2811+tachyon
if you are not afraid of Forth.
http://propaneandelectrons.com/blog/the-difference-between-ws2811-and-ws2812
looks like one is the driver chip, the other the LED with the chip.
So Peter's code should work for a very impressive interactive demo.
http://en.wikipedia.org/wiki/Web_colors
You can send these to your array, however many at a time as you like. You will find that many many of them just appear white because the apparent luminosity is very non-linear.
This can be partially fixed by dividing each color value by whatever it takes.
But the bottom line is, in my experience, that these devices can actually display only a few tens of distinguishable colors.
I would suggest that the devices can display the entire range -- our eyes, however, are unable to discerns subtle differences between them.
It cycles through all the possible colors, but can increment by more than unity AND doesn't take each color value up to 255. Depending on the StepSize and MaxColor, it takes "a few minutes" to run.
It would be interesting to put a Ws821X and a TCS3200-DB Color Sensor in a light-proof box to see have many color values can be generated. But, "A difference is a difference only if it makes a difference". How many can the viewer distinguish is what really counts.
Make sure and let us know if you want some help. There are obviously lots of willing helpers around here.
Is there a way to poll the light string to see how many lights there are? I am assuming the controller is a broadcast only setup with no response? I suppose you could feed the last cell back to the Propeller for counting the LED's. Then if you send out a string for 20 leds and you get back 15 of them then you know there are 5 LEDS?
I am asking because I am seriously looking at making a 60" light bar for my truck doing different things but will use the modules to test out the software.
Rodney
You're correct in assuming you can't poll the LED directly. Your idea of monitoring the output of the final LED to see how many LEDs are in the strand should work.
Using JonnyMac's object it would go something like this. What this does is fill the stip slowly, showing the current LED count on the PST. It fills it with white to ensure you're testing the maximum current the strip can consume.
Keep an eye on your power consumption as the count increments to ensure there is enough power available. You can increase or decrease the delay to speed things up or slow them down.
Am I just measuring the current to make sure any voltage regulation I integrate is big enough to power the strip or am I missing something?
And I am assuming I would test this with a standard VOM amperage tester? (Mine has a DC 10amp limit tester in it that I am assuming I would put in series with the DC supply since I have never used it.)
Rodney
Example:
1 LED = 80ma
80% of Power Supply Max Rating = 1A
1A / 0.08A = 12.5 LEDs
So around 12 LEDs you'd want to start being aware of your power supply. If you buy a strips it is best to parallel them with heavy gauge +5 and ground. Looking back I noticed 60" light bar, I was thinking a lot more than that. There are strips of 72 WS821x LEDs on eBay pretty cheap. If you buy a strip it should say how many LEDs are on it. If you buy the individual LEDs I'm sure you'll know how many there are because you'll have to wire them all
I will likely be purchasing a 2 meter length light bar and cut it down (They sell by 1 meter increments but the light bars are made in 2 meter lengths and you can cut them down. ) I am not sure yet what density I want to use. I MAY play with the 144led/meter bars. The 96 LED bars are cheaper but I want as bright as I can get and try to make it not look so much like it is an LED bar.
Rodney
-Mike
Rodney
http://www.digikey.com/product-search/en?KeyWords=OKX-T%2F16-D12N-C&WT.z_header=search_go
There's also a surface mount version that wouldn't be hard to wire to
Question though.. Does that handle an automotive environment well? It showed max input of 14 volts and I know normally you can have spikes up to 30 in a vehicle. Would be a nice easy way to do my voltage regulation for any of my projects though when a simple regulator is not big enough.
Rodney
I've also worked with the MIC261203 which takes up to 28v puts out up to 12 Amps. There's an evaluation board for $41 at digikey. These are also good if you have old laptop supplies around (15~20v DC)
It does cost $70 for the unit but that also includes a protective cover for it. I may just go that route because of the simplicity.
This is the unit here:
http://store.mp3car.com/collections/our-products/products/dcdc-usb-200-intelligent-dc-dc-converter-with-usb-interface-for-programming
Rodney
That's funny I have almost the same supply you linked. It has been rock solid in the past two vehicles I used it in.