Actually I don't have yellow LEDs, but blue LEDs for the GPS device.
But I've got another board - I hope they do not differ.
But, most likely something went wrong with the adding or replacing of the new code.
The first section of my code has to be added in the funcion alarmPatternComposer (did I write something like alarmHandler? Maybe that is the reason - sorry) like follows
Code: Select all
void alarmPatternComposer(){
static char resource = 0;
// patternDecode(length1,length2,length3,beeppause,endpause,loop)
#if defined(BUZZER)
resource = 1; //buzzer selected
if (alarmArray[1] == 2) patternDecode(resource,200,0,0,50,2000); //failsafe "find me" signal
else if (alarmArray[1] == 1 || alarmArray[8] == 1) patternDecode(resource,50,200,200,50,50); //failsafe "panic" or Acc not calibrated
else if (alarmArray[0] == 1) patternDecode(resource,50,0,0,50,0); //toggle 1
else if (alarmArray[0] == 2) patternDecode(resource,50,50,0,50,0); //toggle 2
else if (alarmArray[0] > 2) patternDecode(resource,50,50,50,50,0); //toggle else
else if (alarmArray[2] == 2) patternDecode(resource,50,50,0,50,50); //gps installed but no fix
else if (alarmArray[3] == 1) patternDecode(resource,50,50,50,50,50); //BeeperOn
else if (alarmArray[4] == 1) patternDecode(resource,50,50,0,50,120); //pMeter Warning
else if (alarmArray[5] == 1) patternDecode(resource,50,50,50,50,0); //Runtime warning
else if (alarmArray[6] == 4) patternDecode(resource,50,50,200,50,2000); //vbat critical
else if (alarmArray[6] == 2) patternDecode(resource,50,200,0,50,2000); //vbat warning
else if (alarmArray[6] == 1) patternDecode(resource,200,0,0,50,2000); //vbat info
else if (alarmArray[7] == 1) patternDecode(resource,200,0,0,50,200); //confirmation indicator 1x
else if (alarmArray[7] == 2) patternDecode(resource,200,200,0,50,200); //confirmation indicator 2x
else if (alarmArray[7] > 2) patternDecode(resource,200,200,200,50,200); //confirmation indicator 3x
else if (SequenceActive[(uint8_t)resource] == 1) patternDecode(resource,0,0,0,0,0); // finish last sequence if not finished yet
else turnOff(resource); // turn off the resource
alarmArray[8] = 0; //reset acc not calibrated
#endif
#if defined(PILOTLAMP)
if (alarmArray[9] == 1) PilotLampSequence(100,B000111,2); //I2C Error
else if (alarmArray[3] == 1) PilotLampSequence(100,B0101<<8|B00010001,4); //BeeperOn
else{
resource = 2;
if (f.ARMED && f.ANGLE_MODE) patternDecode(resource,100,100,100,100,1000); //Green Slow Blink-->angle
else if (f.ARMED && f.HORIZON_MODE) patternDecode(resource,200,200,200,100,1000); //Green mid Blink-->horizon
else if (f.ARMED) patternDecode(resource,100,100,0,100,1000); //Green fast Blink-->acro
else turnOff(resource); //switch off
resource = 3;
#if GPS
if (alarmArray[2]==1) patternDecode(resource,100,100,100,100,100); // blue fast blink -->no gps fix
else if (f.GPS_HOME_MODE || f.GPS_HOLD_MODE) patternDecode(resource,100,100,100,100,1000); //blue slow blink --> gps active
else setTiming(resource,100,1000); //blue short blink -->gps fix ok
#else
turnOff(resource);
#endif
resource = 4;
if (alarmArray[1] == 1) setTiming(resource,100,100); //Red fast blink--> failsafe panic
else if (alarmArray[1] == 2) patternDecode(resource,1000,0,0,0,2000); //red slow blink--> failsafe find me
else turnOff(resource);
}
#endif
#if defined(LED_MONITOR)
resource = 5;
if (alarmArray[9] == 1) setTiming(resource,100,100); //all very fast blink -->I2C Error
#if defined(FAILSAFE)
else if (alarmArray[1] == 2) patternDecode(resource,100,100,100,100,1000); //all triple blink --> failsafe level2
else if (alarmArray[1] == 1) patternDecode(resource,100,100,0,100,1000); //all double blink --> failsafe level1
#endif
else {
resource = 2;
if (f.ARMED) {
if (!f.ACC_CALIBRATED) patternDecode(resource,100,100,100,100,1000); //green triple blink --> multiwii not stable or uncalibrated
else if (f.ANGLE_MODE) turnOn(resource); //green static --> angle
else if (f.HORIZON_MODE) patternDecode(resource,200,200,0,100,1000); //green slow blink --> horizon
else patternDecode(resource,100,100,0,100,1000); //green fast blink --> acro
}
else turnOff(resource); //not armed --> switch off
resource = 3;
#if GPS
if (alarmArray[2] == 1) patternDecode(resource,100,100,100,100,1000); //blue triple blink --> no gps fix
else if (f.GPS_HOLD_MODE) patternDecode(resource,200,200,0,100,1000); //blue slow blink --> gps hold position
else if (f.GPS_HOME_MODE) patternDecode(resource,100,100,0,100,1000); //blue fast blink --> gps return to home
else turnOn(resource); //permanent blue --> gps fix ok
#else
turnOn(resource);
#endif
resource = 4;
#if defined(VBAT)
if (alarmArray[6] == 4) setTiming(resource,100,100); //red very fast blink --> low bat warning2
else if (alarmArray[6]==2) patternDecode(resource,100,100,100,100,1000); //red triple blink --> low bat warning1
else
#if defined(POWERMETER)
if (alarmArray[4]==1) patternDecode(resource,200,200,0,100,1000); //red slow blink --> powermeter warning
else turnOn(resource);
#else
turnOn(resource);
#endif
#endif
}
#endif
}