Calvo
Calvo

Reputation: 11

Clearing NeoPixel LEDs after running animate()?

I'm trying to run an animation for a period of time, then clear the LEDs and go back to setting the colors manually with Neopixel.pixels.fill(). Only, after I run animation.animate(), I lose the ability to use pixels.fill() I tried using the sequence library with the auto_clear and auto_reset flags, but those did not seem to work either.

rainbow = Rainbow(macropad.pixels, speed = 0.005, period = 2)
animations = AnimationSequence(rainbow, auto_clear=True, auto_reset=True)

i = 0
while True:
    animations.animate()
    i += 1
    if (i == 100):
         animations.reset()
         break

Upvotes: 1

Views: 130

Answers (0)

Related Questions