Hi, I need a bit of advice. I am a newbie to FastLED and Arduino. I need to blink specific leds on my strip with specific frequency at the same time. E.g. while the first led is blinking 1/s, the second led 2/s. Is there any function in FastLed dealing with this? I did some research, but without any success. Thanks a lot.
Many thanks, this is suitable for examples I have provided, however I also need to blink a led for 1s (let’s say) every 5 minutes.
Therefore the code similar to:
leds[0] = CRGB::White; FastLED.show(); delay(1000);
leds[0] = CRGB::Black; FastLED.show(); delay(300000);
but indeed it doesn’t work for many more leds to be switched on at the same time, as there is delay. Ideally, I need something like:
I think I’m on the right way. I have tried:
EVERY_N_SECONDS(1000) { leds[0] = CRGB::White; };
FastLED.show();
but led keeps switched on and not blinking, so I changed the code to:
leds[0] = CRGB::Black;
FastLED.show();
EVERY_N_SECONDS(1) { leds[0] = CRGB::White; }
FastLED.show();
it works pretty well, but I cannot control time of led, when is switched on. It flashes every second for cca 1ms (?).
I have an idea to test millis timing using a bit dirty way:
if (millis()%1000==0){
leds[0] = CRGB::White;
FastLED.show();
}
if (millis()%3010==0) {
leds[0] = CRGB::Black;
FastLED.show();
}
it works very well. Hope this “dirty” way is OK and the code will fit to memory. I’m using 96 leds and to address each individually will consume much of memory. I have to test it.