Having status LED's on the board is nice, but they're next to useless when the board is mounted in the stack or under a cover. The next rev of the board IMO should be designed so that these LED's can be mounted remotely. A simple pin header could either be jumpered to use the on-board LEDs or used as a connector for remote LEDs. At a minimum, the user needs to see the arm/disarm LED and the GPS lock LED.
Here's what you need to know in the code. Long story short, you can plug small external LED's into the board, set LED_Mode to 107.
// Copter LEDS by Robert Lefebvre
// Based on the work of U4eake, Bill Sanford, Max Levine, and Oliver
// g.copter_leds_mode controls the copter leds function via bitmath
// Zeroeth bit turns motor leds on and off: 00000001
// First bit turns GPS function on and off: 00000010
// Second bit turns Aux function on and off: 00000100
// Third bit turns on Beeper (legacy Piezo) function: 00001000
// Fourth bit toggles between Fast Flash or Oscillate on Low Battery: 00010000 (0) does Fast Flash, (1) does Oscillate
// Fifth bit causes motor LEDs to Nav Blink: 00100000
// Sixth bit causes GPS LEDs to Nav Blink: 01000000
// This code is written in order to be backwards compatible with the old Motor_LEDS code
// I hope to include at least some of the Show_LEDS code in the future
// copter_leds_GPS_blink controls the blinking of the GPS LEDS
// copter_leds_motor_blink controls the blinking of the motor LEDS
// Piezo Code and beeps once on Startup to verify operation
// Piezo Enables Tone on reaching low battery or current alert
#define COPTER_LEDS ENABLED
#define COPTER_LED_ON HIGH
#define COPTER_LED_OFF LOW
#if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2
#define COPTER_LED_1 AN4 // Motor or Aux LED
#define COPTER_LED_2 AN5 // Motor LED or Beeper
#define COPTER_LED_3 AN6 // Motor or GPS LED
#define COPTER_LED_4 AN7 // Motor LED
#define COPTER_LED_5 AN8 // Motor LED
#define COPTER_LED_6 AN9 // Motor LED
#define COPTER_LED_7 AN10 // Motor LED
#define COPTER_LED_8 AN11 // Motor LED
#elif CONFIG_APM_HARDWARE == APM_HARDWARE_APM1
#define COPTER_LED_1 AN8 // Motor or Aux LED
#define COPTER_LED_2 AN9 // Motor LED
#define COPTER_LED_3 AN10 // Motor or GPS LED
#define COPTER_LED_4 AN11 // Motor LED
#define COPTER_LED_5 AN12 // Motor LED
#define COPTER_LED_6 AN13 // Motor LED
#define COPTER_LED_7 AN14 // Motor LED
#define COPTER_LED_8 AN15 // Motor LED
Thanks. Silly me thinking hardware when software will do.
This worked like a charm. I have a red LED and blue LED each wired in series with a 220 ohm resistor and connected to AN4 and AN6 respectively. After a tweak in MP to set the LED_MODE, it is doing exactly what I want. Thanks!
As a bulder of a HK HAL frame based quad with APM Mega 2.5, I have a problem of not easily being able to observe the GPS locked or ARM/DISARMED leds when flying.
Having no clue how to do any adru code changes, it is way out of my capability to make code changes to enable Leds as R_Lefebvre suggested.
Is there no easy way to connect 2 or 3 LEDS to the 2.5 hardware?
Thanks for patience. I have searched threads for hours and this is closest one to my issue/desire that I found.
Thanks... As soon as I'm over understanding PIDS etc and getting some flight time in (as I just had first proper stable flight yesterday on 2.8.1) I'm going to look into the software development. I do embeded stuff now using VB.NET on windows and CE machines but need to bite the bullet and understand the Arduino.
I look forward to it.
I'm making changes in that direction. Beeper is done, LEDs are like 20..30%. Having some trips and small amount of free time I expect to have working version in one month.
Some sneak peak - this was taken after beeper part was more or less done. Right now LED part is developed. I'm aiming flexible customization to satisfy wide audience.
And the only hardware we need costs less than $1 (beeper, ULN2803A).
Marooned, looking good! If you have the interface done such that the LED control is working as-is, can you please push it to MP so people can use it ASAP?
Only beeper is done so far. Still working on LED to maintain current version and add more flexible ones. Developing both part (C++ on uC and C# for MissionPlanner) takes some time.
Anyway, all my changes that are ready to usage are here. Better explanation is in Beeper extraction thread on dev's mailing list.
That's the aim of that changes. I have few more UX/UI tasks for MP on my todo list ;-)
Monroe, yes, I saw the importance of external LEDs myself a long time ago. It's too hard to see the little ones onboard. For a long time I was flying my heli without even arming it (you don't have to on TradHeli). So yeah... That's why I did this, but I couldn't do the UI myself unfortunately. I made it as easy as I could with a bitmask and code commenting.
Though to be fair, much of this already existed, I just improved it.
Nice work, excited to see this released.
You do not need to make any code changes. This all works with the standard code.
All you have to do, is set the parameter LED_Mode to... '107' for example. That enables most features.
Then plug something like this:
Into the AN6 port after moving the red wire from the middle slot in the plug to the 1st slot on the plug. (the actual output from the controller is on the innermost pin of the auxiliary rail. The middle pin is 5V always on.
Then, you will get the GPS signals repeated out.
Done. Simple as that.