Browse Source

* T1000e battery measure fix

pull/65/head
Scott Powell 1 year ago
parent
commit
9b5a294695
  1. 5
      src/helpers/nrf52/T1000eBoard.h

5
src/helpers/nrf52/T1000eBoard.h

@ -31,8 +31,13 @@ public:
uint16_t getBattMilliVolts() override {
#ifdef BATTERY_PIN
analogReference(AR_INTERNAL_3_0);
analogReadResolution(12);
float volts = (analogRead(BATTERY_PIN) * ADC_MULTIPLIER * AREF_VOLTAGE) / 4096;
analogReference(AR_DEFAULT); // put back to default
analogReadResolution(10);
return volts * 1000;
#else
return 0;

Loading…
Cancel
Save