Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help getting a group of leds to blink at once. #795

Open
bonus41 opened this issue May 18, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@bonus41
Copy link

commented May 18, 2019

I'm trying to get a group of LEDs to blink at the same time. Problem is right now they are all blinking out of sync... I've been using this code
Leds[54] = CRGB::Green; FastLED.show () ;
Leds[55] = CRGB::Green; FastLED.show () ;
Leds[56] = CRGB::Green; FastLED.show () ;
Leds[54] = CRGB::Black; FastLED.show () ; delay (30);
Leds[55] = CRGB::Black; FastLED.show () ; delay (30);
Leds[56] = CRGB::Black; FastLED.show () ; delay (30);
}

I can get them all to be solid, I can get 1 led to blink the way I want it... but when I add the other 2 they are all blinking out of sync

@focalintent

This comment has been minimized.

Copy link
Member

commented May 18, 2019

Every time you call FastLED.show() it writes out all the LED data - so what you want to do is set the value of all the LEDs that you want in a single frame before calling show. For example:

    leds[54] = CRGB::Green;
    leds[55] = CRGB::Green;
    leds[56] = CRGB::Green;
    // done setting all the led data, now call show
    FastLED.show();
    delay(30);

    leds[54] = CRGB::Black;
    leds[55] = CRGB::Black;
    leds[56] = CRGB::Black;
    FastLED.show();
    delay(30);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.