From 2591bff0e249e224a2a63b6bdebcf644a28ee011 Mon Sep 17 00:00:00 2001 From: atse Date: Thu, 25 Jan 2024 16:25:45 +0800 Subject: [PATCH] Give time for dac value to settle when calibrating --- src/channels.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/channels.rs b/src/channels.rs index c2a2900..e33a0b6 100644 --- a/src/channels.rs +++ b/src/channels.rs @@ -21,6 +21,7 @@ use crate::{ pins, steinhart_hart, hw_rev, + timer, }; pub const CHANNELS: usize = 2; @@ -273,6 +274,7 @@ impl<'a> Channels<'a> { let mut best_error = ElectricPotential::new::(100.0); for step in (0..18).rev() { + timer::sleep(5); let mut prev_value = start_value; for value in (start_value..=ad5680::MAX_VALUE).step_by(1 << step) { match channel {