Simultaneously Display on Multiple NeoPixels

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
k80
 
Posts: 15
Joined: Thu Mar 20, 2014 5:23 pm

Simultaneously Display on Multiple NeoPixels

Post by k80 »

I'm trying to figure out a way to make an entire NeoPixel ring pulse in sync.
As far as I can tell there's no simple way in Arduino to address multiple pixels in the ring to display at the same time, the closest I can get is having them follow around the ring.

This is the generic form of the pulse I'm trying to apply to all of the pixels simultaneously:

int pulsefunction(int p){
strip.setPixelColor(0, 255, 0, 0);
strip.show();
delay (250);
strip.setPixelColor(0, 191, 0, 0);
strip.show();
delay (250);
strip.setPixelColor(0, 127, 0, 0);
strip.show();
delay (250);
strip.setPixelColor(0, 63, 0, 0);
strip.show();
delay (250);
strip.setPixelColor(0, 127, 0, 0);
strip.show();
delay (250);
strip.setPixelColor(0, 191, 0, 0);
strip.show();
delay (250);
}

User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: Simultaneously Display on Multiple NeoPixels

Post by Franklin97355 »

You are setting only one pixel with this code

Code: Select all

strip.setPixelColor(0, 255, 0, 0);
You need a loop around that like (not real code)

Code: Select all

for(i, i<numpixels, i++) {
strip.setPixelColor(i, 255, 0, 0);
}
strip.show();

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

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