[SOLVED] Flashing an LED during autonomous flight with Python API

Post here to get support
Post Reply
wingjet
Beginner
Posts: 2
Joined: Sun Nov 12, 2017 10:23 pm

[SOLVED] Flashing an LED during autonomous flight with Python API

Post by wingjet »

Is it possible to flash the LED built onto the crazyflie using a python script, if so how would I do it? I mainly plan on flashing the LEDs during my scripted flight pattern I already made. If it's not possible using a Python script how would I go about doing this by editing the firmware? Thanks in advance!
Last edited by wingjet on Mon Nov 27, 2017 8:10 pm, edited 1 time in total.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Flashing an LED during autonomous flight with Python API

Post by kristoffer »

No, it is not possible to flash the built in LEDs from a python script out of the box.

Controlling the LEDs in the Crazyflie firmware is not completely straight forward. The LEDs are controlled as sequences implemented in ledseq.c.
You could maybe:
1. remove one of the LEDs from the sequence handling and control it your self from a parameter that you control from python
2. set up your own sequence and use it to control the LED. Note that there is some sort of prioritisation between sequences, so you might have to stop a higher prio sequence that is already running (see https://github.com/bitcraze/crazyflie-f ... 1f121dbb7d for some ideas)
Post Reply