Controlling the onboard LEDs (M1, M2. M3, M4) in Python

Firmware/software/electronics/mechanics
Post Reply
mbaytas
Beginner
Posts: 4
Joined: Mon Mar 16, 2020 6:10 pm

Controlling the onboard LEDs (M1, M2. M3, M4) in Python

Post by mbaytas »

We'd like to take control of the onboard LEDs (M1, M2, M3, M4) while flying with a synchronous Python script, and write R/G/B values in real time like we do on the LED ring.

We have searched the library source, docs, and the forum to find how to do this. The closest we got was a post from a few years ago (viewtopic.php?t=2695), where the answer is basically "no." I'm wondering if there are any new developments since then.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Controlling the onboard LEDs (M1, M2. M3, M4) in Python

Post by kristoffer »

Hi!

It still works the same way and the previous answer is still valid.

Please note that the LEDs are not RGB and it will not be possible to set any color. The two front LEDs are red/green and the two at the back are blue only (see schematics https://www.bitcraze.io/documentation/h ... _rev.b.pdf)
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Controlling the onboard LEDs (M1, M2. M3, M4) in Python

Post by tobias »

I just created an github issue for this and there is a patch there you could try out.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Controlling the onboard LEDs (M1, M2. M3, M4) in Python

Post by tobias »

A implementation has now been merged in PR#854
Post Reply