Float voltage to int (#444)
* Change voltage float to millivolt integer * Explain the ADC to milliVolts conversion
This commit is contained in:
@@ -50,7 +50,7 @@ namespace Pinetime {
|
||||
return percentRemainingBuffer.GetAverage();
|
||||
}
|
||||
|
||||
float Voltage() const {
|
||||
uint16_t Voltage() const {
|
||||
return voltage;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Pinetime {
|
||||
static constexpr uint32_t chargingPin = 12;
|
||||
static constexpr uint32_t powerPresentPin = 19;
|
||||
static constexpr nrf_saadc_input_t batteryVoltageAdcInput = NRF_SAADC_INPUT_AIN7;
|
||||
float voltage = 0.0f;
|
||||
uint16_t voltage = 0;
|
||||
int percentRemaining = -1;
|
||||
|
||||
bool isCharging = false;
|
||||
@@ -86,4 +86,4 @@ namespace Pinetime {
|
||||
uint8_t samples = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user