Update adc.c

This commit is contained in:
chucknorris101 2022-11-07 09:47:17 -06:00 committed by GitHub
parent 359fc4bc66
commit 9c272383c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -102,8 +102,8 @@ prst_adc_batt_read_t prst_adc_batt_read() {
static inline double get_soil_moisture_percent(
double battery_voltage, nrf_saadc_value_t raw_adc_output) {
const double x = battery_voltage;
const double dry = -12.9 * x * x + 111 * x + 228;
const double wet = -5.71 * x * x + 60.2 * x + 126;
const double dry = 59.66 * x + 331;
const double wet = 34.44 * x + 173;
#if PRST_ADC_SOIL_DEBUG
NRF_LOG_INFO("[adc] batt: " NRF_LOG_FLOAT_MARKER, NRF_LOG_FLOAT(x));
NRF_LOG_INFO("[adc] dry: " NRF_LOG_FLOAT_MARKER " wet: " NRF_LOG_FLOAT_MARKER,