LettherebeLight:
And Yes, i will need it for exactly 32 pixel ring.
What should i change on the code?
change
const int NUMPIXELS = 24;
You can also change the other constants to alter the colour and the cycle time.
LettherebeLight:
Do you recommend i get an Arduino Uno or Arduino Pro trinket?
Any suggestions?
No sugestions - I did this on an Uno with my 24-pixel ring, worked fine.
The length of the tail is fixed to being half the pixels. Oh - there's a coding error. This
float bright = (i / (float)NUMPIXELS);
Should be
float bright = (i / (float)(NUMPIXELS/2);
I'll fix it now … ok, fixed.
Another adjustment that might be fun to play with would be gamma correction.
This line:
bright *= bright;
Squares the brightness, which imposes a gamma of .5 (or 2, depending on which way you look at it).
You can have an arbitrary gamma with
bright = pow(bright, GAMMA);
make GAMMA a const float varying between 0 and infinity. no gamma is equivalent to GAMMA = 1.
(another brightness adjustment is exponential decay - bright = exp((bright-1)*DECAY);
- a decay value of 3 produces a nice result on my setup)
Compicated stuff potentially takes a while to compute, and I would be inclined to precalculate the tail colours in setup() and stuff them into an array. But, the chip is fast enough if this is all that it's doing, so meh. Come to think of it - this would be a nice application for my control some neopixels using an android tablet over bluetooth (demo here) setup.