Dear team,
I’m trying to run this simple piece of code to make my neopixel ring breath, just once. However it seems to continually breath and I can’t seem to interrupt it. I can see the for loop but my understanding is that determines the brightness graduation unless i’m wrong. All suggestions welcome.
void loop() {
glowblue();
delay(5000);
}
void glowblue() {
int TOTAL_LEDS = 24;
float MaximumBrightness = 255;
float SpeedFactor = 0.002; // I don't actually know what would look good
float StepDelay = 5; // ms for a step delay on the lights
// Make the lights breathe
for (int i = 0; i < 65535; i++) {
// Intensity will go from 10 - MaximumBrightness in a "breathing" manner
float intensity = MaximumBrightness / 2.0 * (1.0 + SpeedFactor * i);
strip.setBrightness(intensity);
// Now set every LED to that color
for (int ledNumber = 0; ledNumber < TOTAL_LEDS; ledNumber++) {
strip.setPixelColor(ledNumber, 0, 0, 255);
}
strip.show();
//Wait a bit before continuing to breathe
delay(StepDelay);
}
}