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.

Thoughts?

Views: 5984

Reply to This

Replies to This Discussion

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
/////////////////////////////////////////////////////////////////////////////////////////////

And:

////////////////////////////////////////////////////////////////////////////////
// CopterLEDs
//

#ifndef COPTER_LEDS
#define COPTER_LEDS ENABLED
#endif

#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
#endif


//////////////////////////////////////////////////////////////////////////////

Thanks. Silly me thinking hardware when software will do.

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

Stay tuned.

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?

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:

http://www.hobbyking.com/hobbyking/store/__17186__3_LED_Strip_BLUE....

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.

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

This is my point exactly. I have no idea what "setting the parameter LED_Mode to... '107'" means. But I guess that is a bit esoteric if you guys have been mulling this over for a while. Me, as a new convert to multicopters and ardupilot, am finding that the nitty gritty of the software doing all this is in the list to learn. Just getting my quad, called Red Dwarf by the way, flying is consuming all my spare time yet I still would like to get LEDs out on the dome to see when it is armed and the GPS has a lock.

I look forward to knowing what your talking about. It won't be that far from now.

Cudo's to you guys. This is amazing stuff and your efforts are to be applauded.

Rolf

Rolf, this is actually easy.

1) run Mission Planner

2) go to "Configuration" tab

3) connect to APM board

4) select "Adv Parameter List" from left panel

5) find "LED_MODE" on the list

6) double click on the number next to it

7) enter "107" (which is something called bitmask enabling and disabling some features of that LED code)

8) click "write params" on the right and wait a few seconds to be sure (info on succeed in on my todo list)

That's it.

Hope it helps.

Sound straight forward.... Off to the workshop to give it a shot.

Thanks.

Reply to Discussion

RSS

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service