Blink green onLed when low voltage shutdown

pull/49/head
alanbjohnston 6 years ago committed by GitHub
parent 4e0db0fe72
commit 8a2444fd29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -554,6 +554,17 @@ while (loop-- != 0)
if ((batteryVoltage > 0) && (batteryVoltage < batteryThreshold))
{
fprintf(stderr,"Battery voltage too low: %f V - shutting down!\n", batteryVoltage);
digitalWrite (onLed, onLedOff);
sleep(1);
digitalWrite (onLed, onLedOn);
sleep(1);
digitalWrite (onLed, onLedOff);
sleep(1);
digitalWrite (onLed, onLedOn);
sleep(1);
digitalWrite (onLed, onLedOff);
popen("sudo shutdown -h now > /dev/null 2>&1", "r");
}

Loading…
Cancel
Save

Powered by TurnKey Linux.