config stuff

This commit is contained in:
2024-11-19 18:05:51 +01:00
parent bfcf5e150c
commit 8218c4b9a6
6 changed files with 330 additions and 175 deletions

View File

@@ -56,7 +56,7 @@ use crate::{plant_hal, STAY_ALIVE};
//Only support for 8 right now!
pub const PLANT_COUNT: usize = 8;
const REPEAT_MOIST_MEASURE: usize = 3;
const REPEAT_MOIST_MEASURE: usize = 1;
const SPIFFS_PARTITION_NAME: &str = "storage";
const CONFIG_FILE: &str = "/spiffs/config.cfg";
@@ -387,7 +387,7 @@ impl PlantCtrlBoard<'_> {
.unwrap();
let delay = Delay::new_default();
let measurement = 10;
let measurement = 5000;
let factor = 1000 as f32 / measurement as f32;
//give some time to stabilize
@@ -402,6 +402,7 @@ impl PlantCtrlBoard<'_> {
delay.delay_ms(10);
let unscaled = self.signal_counter.get_counter_value()? as i32;
let hz = (unscaled as f32 * factor) as i32;
println!("raw measure unscaled {} hz {}, plant {} sensor {:?}",unscaled, hz, plant, sensor);
results[repeat] = hz;
//println!("Measuring {:?} @ {} with {}", sensor, plant, hz);
}