Page 1 of 1

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

Posted: Sun Nov 12, 2017 10:39 pm
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!

Re: Flashing an LED during autonomous flight with Python API

Posted: Mon Nov 13, 2017 12:55 pm
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)