diff --git a/src/channels.rs b/src/channels.rs index cfec178..20aa8e6 100644 --- a/src/channels.rs +++ b/src/channels.rs @@ -264,9 +264,9 @@ impl<'a> Channels<'a> { let samples = 50; let mut target_voltage = ElectricPotential::new::(0.0); for _ in 0..samples { - target_voltage = target_voltage + self.get_center(channel); + target_voltage += self.read_vref(channel); } - target_voltage = target_voltage / samples as f64; + target_voltage /= samples as f64; let mut start_value = 1; let mut best_error = ElectricPotential::new::(100.0);