-
Notifications
You must be signed in to change notification settings - Fork 301
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
Update output_devices.py #1003
base: master
Are you sure you want to change the base?
Update output_devices.py #1003
Conversation
Added a "fade_to()" function to the PWMOutputDevice class as well as a mod RGBLED. It uses the same blink thread as the blink function to not interfere with existing scripts. This function takes a fade_time in seconds and fades the value/color from a start value (default: the given value at the moment) to an end value.
Correct typing errors
Add missing colon
fix arithmetic error and typing error
Add a cycle_color() function to RGBLED to rotate the Hue. Can accept clockwise as well as anticlockwise rotation, different speeds and number of rotations. Can start on current value or can be given starting color.
Add RGBLED.cycle_color()
Add in comments and cleanup
So far: |
I think if the RGBLED is currently off (i.e. current colour is black), and you call |
Good Point! Yes, I meant RGBLED and changed it… thanks for the reply 😅 |
I was going to ask "Will most people know what 'luminescence' even means?", but if you're linking to a wikipedia article that hopefully sufficiently explains things. |
Cool... slightly ironic that you mentioned "better description of pwmled.cycle_color()" in your commit-message 🤣 |
For real this time!
True… ^^ I start to get the impression that the documentation to explain, what this function does, is more trouble than the function itself. |
Sorry, please forgive my pickiness! |
gpiozero/output_devices.py
Outdated
the same, so full white (1,1,1) will stay white and black (i.e. off) will stay black. | ||
For best (i.e. most colorful) results, use a pure color (e.g. (1,0,0) ) as a starting value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although perhaps the tuple-values here should be in backticks? 🤔
No worry, I am not offended, but rather glad for the response. Otherwise some stuff might slip through and I want do do the best I can. |
Hello! It's been a while, but is this getting merged at some point? I too would like the provided functionality, hopefully without reinventing the wheel. Thanks |
Add a "fade_to()" function to the PWMOutputDevice class as well as a mod RGBLED. It uses the same blink thread as the blink function to not interfere with existing scripts.
This function takes a fade_time in seconds and fades the value/color from a start value (default: the given value at the moment) to an end value.