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).

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 S...

* 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.

Views: 3739

Tags: arducopter, beeper, bitmask, led, mission, planner

Comment by Kevin Klein on November 29, 2012 at 9:24am

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.

Comment by Marooned on November 29, 2012 at 9:25am

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.


Moderator
Comment by Graham Dyer on November 29, 2012 at 9:44am

Great stuff!

Comment by Scott Berfield on November 29, 2012 at 10:05am
Nice work!

Developer
Comment by Rob_Lefebvre on November 29, 2012 at 10:10am

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.

Comment by captaingeek on November 29, 2012 at 10:50am

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


100KM
Comment by u4eake on November 29, 2012 at 2:47pm

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

Comment by Peter Meister on November 29, 2012 at 11:04pm

Awesome work Marooned!!!


Distributor
Comment by UnmannedTechShop.co.uk on November 30, 2012 at 1:03am

Great stuff will make LEDs much easier to incorporate intonation copter build


Developer
Comment by Marco Robustini on December 1, 2012 at 3:20am

Nice stuff, when we insert it in the official code? :-)

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2014   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service