Skip to content

Conversation

@gemenerik
Copy link
Member

@gemenerik gemenerik commented Oct 22, 2025

Requires bitcraze/color-led-deck-firmware#1 and bitcraze/crazyflie-firmware#1545

Color LED Deck

color_led_cycle.py: Cycles through the HSV color spectrum

  • RGBW color control with HSV-to-RGBW conversion
  • Thermal monitoring with throttling warnings
  • Configurable brightness correction

color_led_set.py: Sets a static RGBW color

  • Direct RGBW channel control
  • Thermal monitoring with throttling warnings
  • Configurable brightness correction

Generic LED Deck

led_cycle.py: Cycles through RGB colors

  • HSV-to-RGB color conversion
  • Simple RGB color control

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
Copy link

Copilot AI left a 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
evoggy
evoggy previously approved these changes Oct 23, 2025
Copy link
Member

@evoggy evoggy left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants