From e09bdc4253a2aac14fbf1b1d16145022882412d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eckhard=20V=C3=B6llm?= Date: Mon, 22 Jan 2024 07:30:37 +0100 Subject: [PATCH] more swing in delay time and fix value in startup G meter check --- main/sensor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/sensor.cpp b/main/sensor.cpp index 3258e6735..23081e92b 100644 --- a/main/sensor.cpp +++ b/main/sensor.cpp @@ -967,15 +967,15 @@ void system_startup(void *args){ } mpud::raw_axes_t accelRaw; float accel = 0; + delay(200); for( auto i=0; i<10; i++ ){ esp_err_t err = MPU.acceleration(&accelRaw); // fetch raw data from the registers if( err != ESP_OK ) ESP_LOGE(FNAME, "AHRS acceleration I2C read error"); mpud::float_axes_t accelG = mpud::accelGravity(accelRaw, mpud::ACCEL_FS_8G); // raw data to gravity ESP_LOGI( FNAME,"MPU %.2f", accelG[0] ); - delay( 5 ); - if( i>0 ) - accel += accelG[0]; + delay( 10 ); + accel += accelG[0]; } char ahrs[30]; sprintf( ahrs,"AHRS Sensor: OK (%.2f g)", accel/10 );