@@ -21,7 +21,7 @@ use crate::{
21
21
const USB_CHARGING_VOLTAGE : u16 = 4200 ;
22
22
const DHT11_WARMUP_DELAY_MILLISECONDS : u64 = 2000 ;
23
23
const SENSOR_WARMUP_DELAY_MILLISECONDS : u64 = 50 ;
24
- const SENSOR_SAMPLE_COUNT : usize = 5 ;
24
+ const SENSOR_SAMPLE_COUNT : usize = 6 ;
25
25
26
26
pub struct SensorPeripherals {
27
27
pub dht11_digital_pin : GpioPin < 1 > ,
@@ -140,7 +140,10 @@ pub async fn sensor_task(
140
140
. push ( Sensor :: AirHumidity ( avg_air_humidity) )
141
141
. expect ( "Too many samples" ) ;
142
142
} else {
143
- warn ! ( "Unable to generate average value of air humidity" ) ;
143
+ warn ! (
144
+ "Unable to generate average value of air humidity - we had {} samples" ,
145
+ air_humidity_samples. len( )
146
+ ) ;
144
147
}
145
148
146
149
if let Some ( avg_air_temperature) = calculate_average ( & mut air_temperature_samples) {
@@ -150,7 +153,10 @@ pub async fn sensor_task(
150
153
. push ( Sensor :: AirTemperature ( avg_air_temperature) )
151
154
. expect ( "Too many samples" ) ;
152
155
} else {
153
- warn ! ( "Unable to generate average value of air temperature" ) ;
156
+ warn ! (
157
+ "Unable to generate average value of air temperature, we had {} samples" ,
158
+ air_temperature_samples. len( )
159
+ ) ;
154
160
}
155
161
156
162
if let Some ( avg_water_level) = calculate_average ( & mut water_level_samples) {
0 commit comments