I'm trying to blink an LED strip at 60 Hz with the following code:
#include <FastLED.h>
#define LED_PIN 7
#define NUM_LEDS 299
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
// Let's take 256 steps to get from blue to red
// (the most possible with an LED with 8 bit RGB values)
for( int colorStep=0; colorStep<256; colorStep++ ) {
int r = colorStep; // Redness starts at zero and goes up to full
int b = 255-colorStep; // Blue starts at full and goes down to zero
int g = 0; // No green needed to go from blue to red
// Now loop though each of the LEDs and set each one to the current color
for(int x = 0; x < NUM_LEDS; x++){
leds[x] = CRGB(r,g,b);
}
// Display the colors we just set on the actual LEDs
FastLED.show();
delay(16);
for(int x = 0; x < NUM_LEDS; x++){
leds[x] = CRGB::Black;
}
FastLED.show();
}
}
but when I run it, I can still see a flicker. I still see a flicker even if i set the delay to 1 millisecond.
I'm trying to get this effect: The Strobe Light Effect (Levitating Water Experiment) - YouTube
but seeing the flicker makes me think that the strip is not actually blinking as fast as the code suggests.
Any suggestions?


