// if ((batteryVoltage > 1.0) && (batteryVoltage < batteryThreshold)) // no battery INA219 will give 0V, no battery plugged into INA219 will read < 1V
/**/
#ifndef HAB
if((batteryCurrent>currentThreshold)&&(batteryVoltage<voltageThreshold)&&!sim_mode)// currentThreshold ensures that this won't happen when running on DC power.
}elseif((batteryCurrent>currentThreshold)&&(batteryVoltage<voltageThreshold)&&!sim_mode)// currentThreshold ensures that this won't happen when running on DC power.
{
fprintf(stderr,"Battery voltage too low: %f V - shutting down!\n",batteryVoltage);
digitalWrite(txLed,txLedOff);
@ -2230,3 +2236,34 @@ if ((uart_fd = serialOpen("/dev/ttyAMA0", 9600)) >= 0) { // was 9600