Turn on individual neopixels at set intervals along a strip?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- rjyusmc2005
- Posts: 4
- Joined: Fri Feb 10, 2017 11:49 pm
Turn on individual neopixels at set intervals along a strip?
Is it possible to turn on individual neopixels at set intervals, without having to specify each individually through strip.setPixelColor()? Say, every 10th or 15th pixel along a strip? For example: have every 10th pixel red while the rest of the strip is blue
- kcl1s
- Posts: 1512
- Joined: Tue Aug 30, 2016 12:06 pm
Re: Turn on individual neopixels at set intervals along a st
No you have to set each pixels color with the setPixelColor(). The good thing is you can easily do that with an incrementing for loop. Something like this will set every 10th pixel.rjyusmc2005 wrote:Is it possible to turn on individual neopixels at set intervals, without having to specify each individually through strip.setPixelColor()? Say, every 10th or 15th pixel along a strip? For example: have every 10th pixel red while the rest of the strip is blue
Code: Select all
for (int i = 0; i < NUMPIXELS; i = i + 10) {
pixels.setPixelColor(i, pixels.Color(R, G, B));
}
pixels.show();
Please be positive and constructive with your questions and comments.