Configure LEDs and beeper in Mission Planner

Hello community!

The beauty of open source is that if you don't like something, you can change it. So here I am showing you my last changes to both: Mission Planner and ArduCopter (in the future it could be moved to library to be used by all Ardu* projects).

mpsignalization.jpg

Before I start I would like to gather all threads about the subject that encouraged me to make all those changes:

* U4eake's showleds, arming and low battery warning leds

* Copter LEDS with APM2?

* 3,2,1... Blink !!!

* Adding External LED Indicators and a Piezo Beeper for Arm and GPS Status

* GPS Fix external led

* Navigation Lights with digital RGB LEDs together with an APM 2.5

* LED stripe setup

* jD-IOBoard

So of course there is jD-IOBoard for $16.00 but we are in DIY community and as we can see in above threads many of us prefer simpler and much cheaper solution (like 8x Darlington for less than $1). So IOBoard is ready out of the box solution but there is still demand on some hacky stuff and this is to address that.

 

There are 2 main areas that the new tab is trying to cover:

1) beeper

2) LEDs

Of course one could attach other elements like relays to those pins but I'll stick to default version.

 

So LEDs part is nothing new (yet). It's just user interface to already existing LED_MODE variable that you can alter via Advanced parameters tab. Instead of calculating bitmask you can now use simple checkboxes. However, I introduced LED_STYLE variable (combobox) to allow me adding more fancy LED behavior leaving "Legacy" one as backward compatible with the current version. This is still work-in-progress.

 

The brand new stuff is beeper part. Currently the beeper is controlled by one bit in LED bitmask enabling or disabling its functionality. With my changes we now have BEEPER_MODE bitmask with 8 functions (I already have idea for 9th one - failsafe - but it will require 2 bytes for the bitfield so it's postponed for now). You can see those 8 features on the attached screen - should be self explanatory. Selecting beeper pin should be possible with incoming changes to the code - for now it's disabled and it's hardcoded as AN5.

 

Every feature has different beep pattern and I tried to keep them quick but recognizable. The code is no longer using delay() function which is very bad (freezing uC code is not what we want it such application).

The changes are still in my branch and we'll see if dev will merge it into trunk to be available for all. If you are willing to test it you will have to grab it from here and flash APM (tested only on APM2 so far) as it adds variables in EEPROM. New Mission Planner is also there.


In the future plans there are other LED styles allowing more flexible LED behaviors. Any suggestions are welcomed.

Hope you like it.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Awesome work Marooned!!!

  • 100KM

    Excellent work!  Makes led patterns so much easier for those without programming skills.  

  • very awesome, this should be integrated with the rest of the code!

  • Looking good Marooned.  Thanks for tackling this. Hopefully you can get it pulled into trunk soon.  The next release is probably going in a week or so.

    It would be really great to make CopterLEDs easy to use for more people as it's a really useful function.

  • Nice work!
  • Moderator

    Great stuff!

  • A agree - it's also not obvious to me what "motor" led should do (without looking in the code). I just used the names that were in the code already.

  • This is great!

    One comment: Can we please stop calling them "Motor" LEDs? That term makes no sense. I suggest we call them "Arm LEDs" instead.

    Or maybe if people like the old names, at least label the checkboxes "Motor Status" and "GPS Status".

    Nitpicky I know, but it makes a big difference to newcomers.

This reply was deleted.