Help using Mavlink data to control LEDs

Hi,I'm converting my DJI phantom 2 to use an APM 2.5 and would like to control the tri coloured LEDs that are under each of the 4 arms of the quad.I've figured out, that the LEDs are controlled using PWM and I've written some test code on an arduino UNO to cycle through the possible states, I,e Off, Red, Green and Yellow ( yellow is actually achieved by red and green on at the same time, but its handled by the DJI combined ESC /LED driver board)Ideally I'd like to get the APM to output the necessary PWM on its output pins, but that would require a custom build and I'm not sure what output pins could deliver hardware PMW, ie as I don't want to put too much additional software load on the CPU.So I guess my next best approach is to use small Arduino e.g. nano or micro, or possibly just a bare Atmega328, programmed with code to listen to the Mavlink output.However I can't find a list of the data that is sent by the mavlink. I know it must be documented somewhere, but I'm not sure where.Ideally the LEDs needs to show initially whether the APM IS ready to fly ie it has GPS lock etc, but in flight Id like to use the LEDs to indicate battery voltage warnings and possibly flight mode etcIf anyone could direct me to any useful information in this regard I'd be gratefulThanksRoger ClarkPs.I've posted the pulse width info required to control the LEDs into an existing related posting on converting the DJI phantom, but they are basically 180uS for Red, 280uS for Green and 380uS for Yellow, and around 100uS will be no LEDs, as will pulse widths above about 450us.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

This reply was deleted.

Activity