0 What to change in code to use LEDs? Posted by majorpr13 on December 22, 2010 at 7:17am Could anyone help, I am trying to use LEDs on the open output ports..what doI need to change in the code to achieve this??? You need to be a member of diydrones to add comments! Join diydrones Tags: arducopter, led, output Email me when people reply – Follow
Replies
Well, sort of. The only thing I see in the code turns on OUT7 when the motors are armed.
//#define IsAM // Do we have motormount LED's. AM = Atraction Mode
if (motorArmed == 1) {
#ifdef IsAM
digitalWrite(FR_LED, HIGH); // AM-Mode
#endif
#define FR_LED 3 // Mega PE4 pin, OUT7
#define RE_LED 2 // Mega PE5 pin, OUT6
#define RI_LED 7 // Mega PH4 pin, OUT5
#define LE_LED 8 // Mega PH5 pin, OUT4
But that is the key. If you use digitalWrite with any one of the four defined outputs you can turn those outputs on/off.
Note: The Eagle schematic for the APM shows PE4 on pin 2, not 3, PE5 on pin 3, not 2.