calibration: read vref direct

This commit is contained in:
atse 2024-02-19 10:34:54 +08:00
parent ae3d8b51d4
commit 832df121a2
1 changed files with 2 additions and 2 deletions

View File

@ -266,9 +266,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);