Update lastBattery value after entering loop