calibration: read vref direct

This commit is contained in:
atse 2024-02-19 10:34:54 +08:00
parent 76547be90a
commit 5aaa1edad7

View File

@ -264,9 +264,9 @@ impl<'a> Channels<'a> {
let samples = 50;
let mut target_voltage = ElectricPotential::new::<volt>(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::<volt>(100.0);