ESP8285
ESP8285 copied to clipboard
Possible wrong update rate math
Hi Kris!
First of all thanks for your efforts! I was looking into your sketch: ESP8285/MPU9250/MPU9250_MS5637_BasicAHRS2_ESP8266.ino and noticed a possible error in the AHRS rate calculation
delt_t = millis() - count;
if (delt_t > 500) { // update LCD once per half-second independent of read rate
...
Serial.print("rate = "); Serial.print((float)sumCount/sum, 2); Serial.println(" Hz");
}
It looks like correct expression should be: (sumCount*1000.0f)/delt_t
delt_t is a serial/display update timing variable, had nothing to do with the fusion rate.