Skip to content

led_driver memory#5

Merged
ArisMorgens merged 6 commits intomainfrom
Aris/led_driver
Mar 26, 2026
Merged

led_driver memory#5
ArisMorgens merged 6 commits intomainfrom
Aris/led_driver

Conversation

@ArisMorgens
Copy link
Copy Markdown
Member

This PR exposes the led_driver memory for the LED ring deck and should be merged after this rust-lib PR is merged.

It is also affected by #4.

@ArisMorgens ArisMorgens marked this pull request as ready for review March 23, 2026 13:51
@ArisMorgens ArisMorgens requested a review from Copilot March 23, 2026 15:00
Copy link
Copy Markdown

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 Python-facing support for writing LED ring colors by exposing the Crazyflie “LED driver” memory via the existing Memory subsystem, enabling easy per-LED color/intensity updates (e.g., for the LED ring deck).

Changes:

  • Introduces a new LedRingColor Python class (Rust #[pyclass]) and exports it through the Rust/Python module surface.
  • Adds Memory.write_led_ring() async method to write exactly 12 LED values to LED driver memory.
  • Adds a new examples/led_ring.py demonstrating usage, and updates Python re-exports + type stubs.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
rust/src/subsystems/mod.rs Re-exports LedRingColor from the memory subsystem.
rust/src/subsystems/memory.rs Adds LedRingColor and Memory.write_led_ring() binding.
rust/src/lib.rs Registers LedRingColor with the _rust Python module.
examples/led_ring.py New example showing how to set individual LEDs and write to the ring.
cflib2/memory.py Re-exports LedRingColor from the Rust extension module.
cflib2/_rust.pyi Updates generated stubs for LedRingColor and Memory.write_led_ring().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rust/src/subsystems/memory.rs
Comment thread rust/src/subsystems/memory.rs Outdated
Comment thread rust/src/subsystems/memory.rs Outdated
@gemenerik gemenerik self-requested a review March 26, 2026 09:48
Copy link
Copy Markdown
Member

@gemenerik gemenerik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@ArisMorgens ArisMorgens merged commit 329bd2c into main Mar 26, 2026
1 check passed
@ArisMorgens ArisMorgens deleted the Aris/led_driver branch March 26, 2026 10:14
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