#Using adafruit_led_animation.animation with neopixel

1 messages · Page 1 of 1 (latest)

quartz lake
#

I have my neopixels setup and working and they light up fine when using the neopixel module. I can also use the adafruit_led_animation.animation module to do Pulse, Blink, etc just fine as well. However, after I do that, I can't seem to command the neopixels individually anymore. For example, neopixels[1] = RED won't work anymore. I tried setting up the neopixel again with neopixels = neopixel.NeoPixel(board.GP0, num_neopixels, auto_write=True), but I get the GP0 in use error.

#

How do I go back to being able to address neopixels individually after using an animation?

zenith scroll
#

the animation only changes the LEDs when you call animate() on it, you can stop calling animate() or pause the animation (with .freeze() and reciprocally .resume())

#

I have used a trick where I just wanted an exception to the animation, so I would set the pixel immediately after calling animate(show=False)

#

something like that:

animation.animate(show=False)
if something:
    pixels[0] = 0xFF0000
pixels.show()
#

actually not sure if pausing will make it stop updating the LEDs if you call animate() 🤔 but the rest is fine

deft kettle
#

I'm not sure either. But my inclination would be to set up the logic to either call animate() or do whatever other manual setting you want.

zenith scroll
#

depending on what you want to do, you can also use PixelMap and AnimationGroup to define multiple animations that drive different animations (including a Solid one for no animation) and swap between them

quartz lake
#

Well, this is weird...I was working on some other code and now the problem seems to have resolved itself.

#

Thanks for all the suggestions

quartz lake
#

Oh I see what I did! Okay, here's the solution that ended up working:

pixel.auto_write = True```