-
Notifications
You must be signed in to change notification settings - Fork 302
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
RGBLED color list cycling #1006
base: master
Are you sure you want to change the base?
Conversation
Kind of a duplicate of #1003 ? |
Similar yes. But the idea here is to cycle over several colors and not only fade between two colors. E.g. we can cycle over all colors by calling the function with red, green and blue. This could also be extented to the blink method to blink in different colors. |
https://github.com/gpiozero/gpiozero/pull/1003/files also adds a |
@AnnoNuem I am open for a collaboration. We could share some approaches and probably find some common ground. |
I think I will not have any time for more coding for this project. However, I will take time for questions and discussion. My idea was a more flexible approach: A parser which can interpret an arbitrary amount of colors, durations and transitions similar to a sheet of music. The existing functions would then become I hope I was at least able to give you some inspiration. |
@AnnoNuem |
Personally I would prefer to keep it all in |
Just IMHO, but a "sheets of color" functionality sounds perhaps like something a bit too complex for a basic "RGBLED" class? Perhaps the https://gpiozero.readthedocs.io/en/stable/source_values.html would be a good way for a 3rd-party project to connect a midi-parser into the rest of the GPIO Zero framework? 🤷 |
Reminds me of https://www.raspberrypi.com/news/this-piano-controls-an-led-rainbow-with-raspberry-pi-zero/ 😀 |
@tinitaet Just wondering: Did you made a decision already? Did you start a new project? |
@AnnoNuem not yet. Unfortunately I am also a bit busy at the moment. |
I was thinking of developing something similar, a library that can parse some set of instructions and display patterns on various types of LEDs, e.g. a simple LED or a WS2812 matrix. I agree that it would be too complex for this library. Perhaps we can agree on some type of protocol that allows intercommunication. Is anyone interested in a collaboration? |
Make the RGBLED fade from a color of a list to the next color of the list. Fades over all colors and back to the first color of the list. Uses colorzero to compute the gradient between two colors of the list.
A new
_cycle_device
function handles the repeated cycling and is also called by the old_blink_device
function.