Give time for dac value to settle when calibrating
This commit is contained in:
parent
d470653385
commit
2591bff0e2
@ -21,6 +21,7 @@ use crate::{
|
|||||||
pins,
|
pins,
|
||||||
steinhart_hart,
|
steinhart_hart,
|
||||||
hw_rev,
|
hw_rev,
|
||||||
|
timer,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const CHANNELS: usize = 2;
|
pub const CHANNELS: usize = 2;
|
||||||
@ -273,6 +274,7 @@ impl<'a> Channels<'a> {
|
|||||||
let mut best_error = ElectricPotential::new::<volt>(100.0);
|
let mut best_error = ElectricPotential::new::<volt>(100.0);
|
||||||
|
|
||||||
for step in (0..18).rev() {
|
for step in (0..18).rev() {
|
||||||
|
timer::sleep(5);
|
||||||
let mut prev_value = start_value;
|
let mut prev_value = start_value;
|
||||||
for value in (start_value..=ad5680::MAX_VALUE).step_by(1 << step) {
|
for value in (start_value..=ad5680::MAX_VALUE).step_by(1 << step) {
|
||||||
match channel {
|
match channel {
|
||||||
|
Loading…
Reference in New Issue
Block a user