adafruit / Adafruit_CircuitPython_LED_Animation

CircuitPython helper library for LED colors and animations
MIT License
53 stars 43 forks source link

Changing rainbow period on the fly #113

Open srmo opened 1 year ago

srmo commented 1 year ago

Ahoi! I'm just starting out with circuitpython and have to say thank you for those amazing libraries. Easy to use and setup and looks great.

Now I'm hitting a wall. I want to change the period of a Rainbow on the fly. The property _period isn't the way to go. speed could be used but this isn't what I want as I want to speed up the color transitions.

I've found a way to use the cycle complete receiver callback logic I.e. I create a new rainbow with the new period on a complete cycle. But this leads to quicker period changes for quicker cycles...erm.

OK, what is my goal here: using the feather nRF52840 express, I create a webserver on a raspi4 which conencts via bluetooth to the feather and provides a WebUI to control brightness and speed of my WS2811 running the rainbow animation. The webserver will receive POST requests and translate them into some UART packets.

This works fine for brightness as I can directly access pixels.brightness mid-animation but I see no way to change the period.

What am I missing? How should I go about it?