Adafruit NeoPixel

Hello everybody,

I have a question about Adafruit NeoPixel.

I'm still a newbie and try to get a sketch to run.

I would like the first pixel lights up then goes out and then the second lights up, etc. ... It just does not work.

Maybe you have an idea why it will not work.

void loop() {

// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.

for(int i=0;i<NUMPIXELS;i++){

pixels.setBrightness(60);

pixels.setPixelColor(i, pixels.Color(0,150,0)); // Moderately bright green color.

pixels.show(); // This sends the updated pixel color to the hardware.

delay(delayval); // Delay for a period of time (in milliseconds).

pixels.setBrightness(0);

pixels.show(); // This sends the updated pixel color to the hardware.
}
}

Thanks in advance

Where is the rest of your sketch? Don't post snippets - please review the "how to use this forum" post at the top of the forum.

How are things wired up? Do you have the grounds connected? Is power connected properly?

What does it mean when you say it "doesn't work"? That could mean you see different pattern than you expect, or that the lights don't turn on, or that the board catches fire. A description of how the observed behavior differs from expected behavior is critical.

When you say it doesn't work, what results are you getting?

I notice your strip name changes from 'pixels' to 'strip' and back again - you need to be consistent.

Can you show us the rest of your sketch. Post it inside code tags to make it easier to read.

It's probably better not to use setBrightness like that - for most sketches you only want to use it once, in the setup() function. My recommendation is that you remove it altogether from loop then switch off the pixels with

strip.setPixelColor(i, pixels.Color(0,0,0));

at the appropriate time.

Many thanks for your help but I could solve itself.

Thank you,

Diabetiker