kriswiner / ESP8285

ESP8285 Development Board
https://www.tindie.com/products/onehorse/esp8285-development-board/
55 stars 17 forks source link

Possible wrong update rate math #2

Open bagobor opened 7 years ago

bagobor commented 7 years ago

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

kriswiner commented 7 years ago

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