I want to make the strip blink (even led numbers on, odd numbers off, then odd numbers on, even numbers off) at 100 or 250 milliseconds intervals with two or three color patterns (purple, yellow, white).
From the tutorial I got it clear how to set up colors for each individual pixel using "strip.setPixelColor(n, x, y, z);" and then applying changes with "strip.show();".
What I don't get is how to configure the duration for each pixel to stay on/off, so I can make the 250ms blink animation; I am not sure that "delay()" would work here.
So, for example If I code:
Code: Select all
strip.setPixelColor(0, 255, 255, 255);
strip.setPixelColor(1, 0, 0, 0);
strip.setPixelColor(2, 255, 255, 255);
strip.setPixelColor(3, 0, 0, 0);
...
//and so on
strip.setPixelColor(n, x, y, z);
//then
strip.show();
But, how can I make them stay like that for a number of milliseconds and then swap to a different state? (inverting status between odd and even leds)
And question 2, I don't really get this thing explained in the tutorial:
Could you provide an example for what it does?You can query the color of a previously-set pixel using getPixelColor():This returns a 32-bit merged color value.Code: Select all
uint32_t color = strip.getPixelColor(11);
The number of pixels in a previously-declared strip can be queried using numPixels():Code: Select all
uint16_t n = strip.numPixels();
By the way, the 50 neopixels on my strip will be split to individual leds (cut by the line drawn between them) and then connected by AWG24 braid copper wire. I don't think that the new distance between pixels (20-30cm between each pixel) is something that must be taken into account but it prefer to be sure.
Thanks for your help :)