Does any1 have an idea on how to setup the arducopter to indicate via different color leds on the motor mounts as to what mode the copter is in, eg. stabilize, alt hold, loiter.
From what i can see in the code (APM_Config.h)
There are these lines:
#define MOTOR_LEDS 1 // 0 = off, 1 = on
#define FR_LED AN12 // Mega PE4 pin, OUT7
#define RE_LED AN14 // Mega PE5 pin, OUT6
#define RI_LED AN10 // Mega PH4 pin, OUT5
#define LE_LED AN8 // Mega PH5 pin, OUT4
From my limited knowledge of C.
The above pins can be set to different conditions (HIGH or LOW), so instead of using them for individual motors, we could use each one for a color of led and mode.
EG.
1. Mount tri color leds on all the motor mounts.
2. Connect pin PE4 to the blue leds (stabilize)
3. Connect pin PE5 to the red leds (loiter)
4. Connect pin PH4 to the green leds (auto)
Then in the code find the variable that is set for the mode. (im still looking...)
Then a simple if then else in the setup loop() (or a function can be made)
if ( stabilizeMode = 1 ) {
digitalWrite(PE4, HIGH);
}
and the same for the other 2 modes.
My syntax is probably not 100%.
But will the idea work????
You need to be a member of diydrones to add comments!
Replies