ESP8285 icon indicating copy to clipboard operation
ESP8285 copied to clipboard

Possible wrong update rate math

Open bagobor opened this issue 8 years ago • 1 comments

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

bagobor avatar Feb 22 '17 20:02 bagobor

delt_t is a serial/display update timing variable, had nothing to do with the fusion rate.

kriswiner avatar Feb 22 '17 22:02 kriswiner