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

  • Hi Marooned,

    No problem, it was worth a shot, thanks for responding so quickly :-)

  • Hi Andrew

    As I stated above, this change is pretty old, was never pulled by main devs and now it's just extremely obsolete. I believe that most of the code is useless for the current codebase. I did not followed ArduPilot changes for a long while and can't help without digging into that code.

    Sorry I couldn't help this time.

  • Hi Marooned, i'm very much a noob when it comes to ardu code and after following many links refering to LED_MODE it seems the code was only ever pulled into the APM-Copter code and not the Plane.

    I have average Arduino skills and have ventured into adding/compiling ardu-plane with copters frsky 3.3v RSSI mod and was going to do the same with the GPS and ARM Led mod but this seems to be quite a different task all together.

    I've found references in the notify code and its called from all over the place within the ardu's common code so it doesn't appear to be overly hard at first glance but i thought i'd save myself a lot of unnecessary pain and ask the questions first :-)

    At the risk of sounding too adventurous, can you advise if this is too big of a task given my skill level or if not what I should keep in mind and where to start?

    I'm not worried about pretty menus so just using the bit number is ok for my purpose but was a bit wary of throwing code in without being aware of any knock-on implications etc..

     

    Anyway, hopefully someone with more knowledge/wisdom than I can advise :-)

    Thanks. 

     

  • Cool beans.... can't wait... 

  • This requires changes in Mission Planner but also in Ardu* code and since the time of my patch a lot has changed. New abstraction layer, move from Google to Git.. I assume most of the code should be write from scratch.

    As a few days ago I finally got my package with the new frame to my copter there are plans to go back to the project but that is not anything around next 2 months unfortunately.

    But I have this in mind, believe me :)

  • Moderator

    An extra bump to try get this into the Mission Planner

  • Great work, glad to have come across this thread... sorry to read about your crash, will await the release in AP. Thanks.

  • At some point I have plans to go back to this changes.

  • Moderator

    That's a pity, this looks really usefull! Sorry about the crash.

  • I must admit that recently something else stole my time and I've not yet jumped from google code to git. So my patch is still on google and because Planner probably changed a lot since then it will require some time to prepare patch for current version.

    Also, my copter has crashed (lack of failsafe hurts) so testing is impossible at the moment.

This reply was deleted.