My girlfriend really wants to have a led hoolahoop and I went out and bought a four meter strip of ws2811 leds and an arduino (uno R3) to start programming it. Turns out my programming knowledge; a couple of years during high school with VB and DHTML5 - isn't really helping me with understanding the C++(ish?) language. I have done some research and found me the FastSPI LED2 library and would like some help writing at least 3 patterns/functions:
a rainbow effect (found one online for the whole strip) that scrolls over the strip, about ten or so led long segments with gaps between them.
a multicolor strobe
fade
I have done some hard wiring in the past with component parts, not worried about figuring those out, it's just the timing of the data behind it that I am having trouble programming I understand the math (conceptually) but not the language variables.
I would rather not just get a script; I would like to learn it... Bond-car project in the future.
i'm not sure exactly what your confused about in the code, but in the main loop you just want to do an analog write the 3 pin (red, Green, Blue) that are on your arduino, and keep changing the values to make cool effects. So for a green fade, write the pin that controls the green to 255, then the others to zero, the every time the loop runs decrease the green
amp625:
i'm not sure exactly what your confused about in the code, but in the main loop you just want to do an analog write the 3 pin (red, Green, Blue) that are on your arduino, and keep changing the values to make cool effects. So for a green fade, write the pin that controls the green to 255, then the others to zero, the every time the loop runs decrease the green
in void loop
i == 255;
analogWrite(greenpin, i);
i = i - 5;
He's using an LED controller chip that does the PWM for all colors itself. It connects to Arduino with only one pin....to control ALL LEDs and ALL colors.
MmmNoodle:
My girlfriend really wants to have a led hoolahoop and I went out and bought a four meter strip of ws2811 leds and an arduino (uno R3) to start programming it. Turns out my programming knowledge; a couple of years during high school with VB and DHTML5 - isn't really helping me with understanding the C++(ish?) language. I have done some research and found me the FastSPI LED2 library and would like some help writing at least 3 patterns/functions:
a rainbow effect (found one online for the whole strip) that scrolls over the strip, about ten or so led long segments with gaps between them.
a multicolor strobe
fade
I have done some hard wiring in the past with component parts, not worried about figuring those out, it's just the timing of the data behind it that I am having trouble programming I understand the math (conceptually) but not the language variables.
I would rather not just get a script; I would like to learn it... Bond-car project in the future.
Really appreciated, thanks!
That's great you want to learn it, not just do it. But, it may be best to see how others do it, and then try to copy that...learning along the way.
Adafruit sells a lot of these, and has written a pretty nice library (and example code) to easily control them!
I looked through the adafruit examples for a quick second, and found similarities to the scripts I have now. I need to find out more about the WheelPos funtion.
PaulRB:
How are you going to get an arduino inside the hoop, and how will you power it?
Once you have it working on an uno, you might be able to get it working with an attiny85.
Batteries may make the hoop unbalanced unless you can distribute them somehow. What's the internal diameter of the hoop?
Paul
I am going to get some 3/4 pvc, arduino mini or nano and power it with rechargeable AAA batteries with a 5v voltage regulator. Not worried about the construction, I am looking for some one who is familiar with the fastSPI library and would like to help me out with some function programming.
as of now i am lost to the ws2811 timing and how I can display more than one led at a time/patterns... So, I guess it'a a waiting game. I also have no idea how most of the symbol functions (e.g. *, %, ect...) work... the arduino reference page isn't very helpful to me.
Yeah, timing is pretty critical with those things. Adafruit claims to have used "hand tuned assembly language" in their library. It involves a bit of port manipulation, and knowledge of clock timing, etc.
They put some good engineers to work creating their library....
Good luck!
PaulRB:
How are you going to get an arduino inside the hoop, and how will you power it?
Once you have it working on an uno, you might be able to get it working with an attiny85.
Batteries may make the hoop unbalanced unless you can distribute them somehow. What's the internal diameter of the hoop?
Paul
I've had no problems running somewhat-complex patterns with a DigiSpark (ATTiny85, USB, built-in regulator, 0.7 inch wide) http://digistump.com/products/1
Or could use this - (also just 0.7 inches wide & USB)
Hehe...add one of these, and could do Persistence Of Vision tricks & motion activated patterns. XD
As for batteries....AA/AAA's should work. Or, if you're adventurous....bust apart a LiPo into it's AA-sized cells, and solder them together, equidistant around the hoop?
(Projects can easily go from simple, to ridiculously complex sometimes in this forum...)
MmmNoodle:
I am looking for some one who is familiar with the fastSPI library and would like to help me out with some function programming.
Why do you want to use that library? Like Dave says, you should use the adafruit neopixel library. It looks very straightforward. Lots of help with the C available on this forum, you already said you want to learn, not have it given to you on a plate, so no problem.
I have done rainbow colour fading recently. Although on rather different hardware, the algorithms would work just as well, so I could help with that if you want.
I use the FastSPI_LED library exclusively. Yes I have tried Adafruit's library, as well as other methods of working with different drivers. FastSPI_LED is by far the best and fastest one. Now, that's not to say the others aren't worth their salt. Each one had its purpose. The end-user needs to decide what works best for them. For all of my LED projects, I stick with FastSPI_LED, from simple pattern generating along a string to high speed POV displays.