diff --git a/src/main.rs b/src/main.rs index 8e4da96..d4a1360 100644 --- a/src/main.rs +++ b/src/main.rs @@ -72,8 +72,8 @@ const SWITCH_PWM_LIMIT: i32 = 93 * SWITCH_PWM_MAX / 100; fn convert_adc_measurements(raw: &[u16; 4]) -> (i32, i32, i32) { let iout = (raw[0] as i32 - raw[1] as i32) * 3300 * 20 / 4096 / 28; // *20 = division by 50 mΩ shunt - let vout = raw[2] as i32 * 3300 * (47 + 10) / 10 / 4096; - let vin = raw[3] as i32 * 3300 * (10 + 10) / 10 / 4096; + let vout = raw[2] as i32 * 3300 * (220 + 10) / 10 / 4096; + let vin = raw[3] as i32 * 3300 * (100 + 10) / 10 / 4096; (vin, vout, iout) /* units: mV, mV, mA */ }