gain conversion

This commit is contained in:
leo 2023-06-15 17:54:08 +02:00
parent 0dbf5aae0e
commit 776291df07
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB

View File

@ -182,7 +182,7 @@ void app_main(void){
ESP_ERROR_CHECK(adc_cali_raw_to_voltage(adc_conv_h[i], val, &mv));
ESP_LOGI(TAG, "IN %d : %d mV (%lu / %lu)", i, mv, meas_res_buff[i], meas_nb_buff[i]);
meas_volts[i] = mv;
meas_amp[i] = mv * 1000000 / ranges[main_conf.range].resistance;
meas_amp[i] = mv * 1000000L / ranges[main_conf.range].resistance / inputs[i].gain;
}
if(meas_volts[UNDERRANGE_SRC] < UNDERRANGE_MV){