Hi All. I have a LED strip(WS2801) of 50 LED's.

Hi All.
I have a LED strip(WS2801) of 50 LED’s. I am searching for a code which light up a LED at the beginning of the strip and sends it down to the end, once it reaches the end it must stay “ON” then send the next dot (Fill up the strip) once full switch them off. (I am using an Arduino MEGA 2560).

Thanks in advance for your help.

Hi! What code do you have so far? How far have you gotten with this?

And do you have an idea of what you want to happen once the lights are “full”? switch them off and then what? Wait for a button push? Or just start again?

I put together a trivial example which just restarts once filled.

http://pastebin.com/F0pJwhPu

Possible improvements:

  • rotating hue
  • let something fancy happen in the filled part
  • add a faiding tail to the moving pixel
  • multiple pixel, sent from the start randomly or with fixed spacing
  • pixel starting at more than one position (e.g. from 2 sides
  • reverse direction
  • etc. etc

It would be easier if you could provide a full working example, so volunteers could just copy and paste and get it running. Some comments in your source wouldn’t hurt either. :slight_smile:

sure - here you go :slight_smile:

http://pastebin.com/Cg7Q1NAt

An extended version with bugfixes, rotating color and a fading tail.

http://pastebin.com/atSp12Ai

Thank you all so much! its just perfect.

Here’s a version I made:

I experimented with a way to slow the filling effect down at the very end by using a delay that exponentially increases. The delay values that control this slowing can be tweaked based on the number of pixels in your strip and what looks good to you visually. But I’m not really sure if it will work for a large NUM_LEDS as I only tested with 32 pixels.

Thanks again for all you help. Got a whole lot more than i expected! :wink: