17,6 → 17,10 |
|
#ifdef USE_FOLLOWME |
int16_t UBat = 120; |
int16_t Zellenzahl = 0; |
int16_t PowerOn = 0; |
int16_t i = 0; |
int16_t delay = 0; |
#endif |
|
#define GPS_RX_TIMEOUT 0x0001 |
67,7 → 71,7 |
|
|
#ifdef USE_FOLLOWME |
BeepTime = 2000; |
//BeepTime = 2000; |
#endif |
|
LCD_Clear(); |
78,7 → 82,7 |
// check for button action |
if(GetButton()) |
{ |
//BeepTime = 200; |
BeepTime = 200; |
Fat16_Init(); |
|
} |
103,6 → 107,28 |
// UAdc4 = R3/(R3+R2)*UBat= 3.9/(3.9+10)*UBat = UBat/3.564 |
UBat = (3 * UBat + (64 * Adc4) / 368) / 4; |
DebugOut.Analog[8] = UBat; |
|
// check for zellenzahl |
if(PowerOn < 100) |
{ |
if(UBat<=84) Zellenzahl = 2; |
else Zellenzahl = 3; |
PowerOn++; |
} |
DebugOut.Analog[16] = Zellenzahl; |
DebugOut.Analog[17] = PowerOn; |
|
//show recognised Zellenzahl to user |
if(i < Zellenzahl && PowerOn >= 100 && BeepTime == 0 && delay > 1000) |
{ |
BeepTime = 100; |
i++; |
delay = 0; |
} |
if(delay < 1500) delay++; |
|
// monitor battery undervoltage |
if(UBat < Zellenzahl * 31 && PowerOn >= 100) BeepTime = 200; |
#endif |
ADReady = 0; |
ADC_Enable(); // restart ad conversion sequence |