Merge pull request #87 from clayton-rogers/change-battery-adc-call

Change to more accurate ADC call
pull/100/head
SQFMI 2021-08-25 21:20:53 -04:00 committed by GitHub
commit 2f12a2babd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -648,7 +648,8 @@ weatherData Watchy::getWeatherData(){
}
float Watchy::getBatteryVoltage(){
return analogRead(ADC_PIN) / 4096.0 * 7.23;
// Battery voltage goes through a 1/2 divider.
return analogReadMilliVolts(ADC_PIN) / 1000.0f * 2.0f;
}
uint16_t Watchy::_readRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len)