Turn on individual neopixels at set intervals along a strip?

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rjyusmc2005
 
Posts: 4
Joined: Fri Feb 10, 2017 11:49 pm

Turn on individual neopixels at set intervals along a strip?

Post by rjyusmc2005 »

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

User avatar
kcl1s
 
Posts: 1512
Joined: Tue Aug 30, 2016 12:06 pm

Re: Turn on individual neopixels at set intervals along a st

Post by kcl1s »

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
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.

Code: Select all

  for (int i = 0; i < NUMPIXELS; i = i + 10) {
    pixels.setPixelColor(i, pixels.Color(R, G, B));
  }
  pixels.show(); 
Keith

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”