Skip to content

Possible wrong update rate math #2

@bagobor

Description

@bagobor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions