don't show voltage if battery not connected

This commit is contained in:
King Kévin 2016-04-04 22:11:48 +02:00
parent cb1c160753
commit c4cd662a19
1 changed files with 2 additions and 1 deletions

3
main.c
View File

@ -424,7 +424,8 @@ int main(void)
printf("battery voltage: %.2fV\n", battery_voltage);
// show voltage on LEDs
if (battery_voltage<2.4) { // low battery voltage
if (battery_voltage<1.0) { // battery probable not connected
} else if (battery_voltage<2.4) { // low battery voltage
for (uint16_t led=0; led<2; led++) { // display red on 2 LEDs
clock_leds[led*3+0] = 0xff; // set red
}