I want to find out if anybody is actually using this code to control their LED lighting? I am trying to work on a single, unified LED lighting program. I am thinking about deleting or completely hijacking Motor_LEDs.
I just wanted to know if that will really mess anybody up?
No? Ok, well I will be hijacking the existing code and changing the name to Copter_LEDS. Will bring in some new functionality that people should like.
Hi Robert, I am using the current leds.pde that Jason created (works great) and just yesterday changed the motor mount leds to match the motor numbers. You can see what I have done here. I have 6 different copter frames with leds and rgb leds and they all show gps status, arming, armed and low-batt. It works very nice. I moved led config into config.h and added apm2 support which I have not tested because I don't have an purple (yet)!
With each release, I modify the code (UserCode, UserVariable and one line of code in ArduCopter) to control external LEDs via APM1’s relay to indicate the state of motor arming and battery voltage. In my opinion, the Arducopter code should perform these basic functions out of the box. Any other function (like blinky LEDs) is nice, but I would turn it off.
Are you addressing these two indications (state of Motor Arming and Battery Voltage)?
Ok guys, I'm going to start the work shortly. I will try not to completely break this until it's working.
Steven, the final result will probably look an awful lot like what you have already done. That's along the lines of what I was already thinking. But thanks for your example because it will help me.
Really, the main point of this, is to make LEDS controllable from MP. Default will be off, but then you just change a parameter to turn it on, and change different modes.
Hi Robert, I'm just trying to get COPTER_LEDS working in 2.5.4.
I've got a uln2803 connected to 3 LED strips, using the outputs AN8,AN10,and AN12, but I can't get them to light up when armed, even with #define COPTER_LEDS 1 in my apm_config.h.
These should work like this shouldn't they?
Yes, it should. Are you using APM1 I presume? Did you previously have motorLEDS working? Can you check for voltage on the pins AN8-12?
Sorry I didn't get notified about this reply.
I am using APM1 and I can get the leds working via u4eake's showleds code, using SHOW_LEDS 1. Previously with 2.5.3 I was using RELAY_LEDS 1 because I just wanted solid lights rather than flashing lights that changed with throttle. However in 2.5.4 when I try to use RELAY_LEDS 1, I hear the relay switching on (or on and off at low battery), but I get no lights. Also if I try COPTER_LEDS 1, I get nothing.
I'm pretty sure my wiring is correct, because if I short all of the ground leads together (instead of running them through the uln2803, the lights will turn on. Also the fact that SHOW_LEDS 1 works.
Glen, if Show LEDs work, then your wiring should be correct for Copter Leds.
Oh, maybe I know why... Go into the Parameters screen in MP, and find the Parameter "LED Mode" and set it to 1. Then Copter Leds should work. That LED Mode controls the mode you are operating in. 1 is the basic setup, where all 8 are "motor leds". They come on when motors are armed, and blink when it's off. And they should oscillate with low battery, but I haven't tested that yet. Oscillate means half on/ half off, blinking. Blink means all off, and all on.
As for the relay, I have no idea, sorry.
If you set LED Mode to 2, then pins 7 and 8 will show you the GPS status.
Thanks for that, will give it a go.
does anybody need gps status? i think the most important things are 1:armed/disarmed 2:battery 3:mode. i was thinking about something like this:
armed: leds on
disarmed: leds off
mode 1: repeated pattern ----------_- (1 short off)
mode 2: repeated pattern ----------_-_- (2 short offs)
mode 3: repeated pattern ----------_-_-_- (3 short offs)
mode 4: repeated pattern ----------_-_-_-_- (4 short offs)
mode 5: repeated pattern ----------_-_-_-_-_- (5 short offs)
battery first warning: repeated pattern ---___---___---___---___ (slow blink)
battery second warning: repeated pattern -_-_-_-_ (fast blink)
this way, theres only one output used for leds, they can be driven by the relay on apm1 and also, they are mostly on so theres no need for other nav lights.
How do I connect up an external gps light and motors armed light on apm2?
You can't yet. But you will when the next code revision comes! And if your LEDs don't draw many amps, then you can connect them direct without a 7803 and it's super easy!