Skip to content
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

A possibility to override and control the Crazyflie 2.X onboard LEDs from the ground #854

Closed
tobbeanton opened this issue Sep 23, 2021 · 3 comments
Milestone

Comments

@tobbeanton
Copy link
Member

Sometimes it is wanted to control the onboard LEDs from e.g. a script rather then letting them show the build in functionality.
The Crazyflie 2.X has 6 controllable LEDs. 5 of them controlled by the STM32F405 and 1 controlled by the nRF51. As not all LEDs are controlled by the same MCU this complicates things a little.

The first step could be a stealth mode so they could all be off, but if they could be controlled individually this would give even bigger value.

@tobbeanton
Copy link
Member Author

This is a first shot at controlling the STM32F405 LEDs through parameters. It needs more work but basically works and could already now be tried out using the patch below.

cf2_ext_led_control_base308ceb32.zip

To override LED control set the led.extCtrl parameter to 1. Setting it to 0 will restore normal functionality.
To control the LEDs set the led.bitpattern parameter. Each bit controls the LED to be on or off and the bit order is according to the led_t enum.
typedef enum {LED_BLUE_L = 0, LED_GREEN_L, LED_RED_L, LED_GREEN_R, LED_RED_R} led_t;
Thus setting led.pitpattern to 0x01 would turn on left blue (M3) LED and all others off.

@jonasdn
Copy link
Contributor

jonasdn commented Sep 23, 2021

Coud you create a pull request from the patch in the zip?

tobbeanton added a commit that referenced this issue Oct 7, 2021
Implementation for #854. Control onboard LEDs via parameters.
@jonasdn
Copy link
Contributor

jonasdn commented Nov 15, 2021

This is possible now on master

@jonasdn jonasdn closed this as completed Nov 15, 2021
@jonasdn jonasdn added this to the next release milestone Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants