-
Couldn't load subscription status.
- Fork 921
Add LED Deck Example Scripts #576
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
base: master
Are you sure you want to change the base?
Conversation
Add two Python examples for controlling the HP RGBW deck: - hprgbw_set.py: Set a static color with configurable RGBW values - Supports both rgbw() and rgb() classes (with auto white extraction) - Easy-to-edit color examples for users - Configurable brightness correction parameter - hprgbw_cycle.py: Cycle through HSV color space - HSV to RGBW conversion for smooth color transitions - Continuous 360° hue cycling Both examples include: - Thermal status monitoring via log subscription (100ms polling) - Warning messages when thermal throttling is active - Proper LED shutdown on Ctrl-C - pack_rgbw() helper to format 0xWWRRGGBB uint32 values
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.
Pull Request Overview
This PR adds example scripts demonstrating LED control for Crazyflie drones with two different LED deck types: a generic RGB LED deck and a color RGBW LED deck with thermal monitoring capabilities.
Key Changes:
- Added HSV-to-RGB/RGBW color conversion utilities for smooth color transitions
- Implemented thermal monitoring with throttling warnings for color LED deck examples
- Added configurable brightness correction support for RGBW LEDs
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| examples/generic_led_deck/led_cycle.py | RGB color cycling example with HSV color space conversion |
| examples/color_led_deck/color_led_set.py | Static RGBW color setter with thermal monitoring and brightness correction |
| examples/color_led_deck/color_led_cycle.py | RGBW color cycling example with thermal monitoring and brightness correction |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…mples Interestingly this was not caught by pre-commit on Python 3.13
Use correct updated parameter name Correctly pack color
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.
Looks good, bit we need to add the Bitcraze copyright header.
Requires bitcraze/color-led-deck-firmware#1 and bitcraze/crazyflie-firmware#1545
Color LED Deck
color_led_cycle.py: Cycles through the HSV color spectrumcolor_led_set.py: Sets a static RGBW colorGeneric LED Deck
led_cycle.py: Cycles through RGB colors