It is good that the good is not complex, makes it easier too review !
There are a few remarks to be made
- millis() % 50 == 0
- Very dangerous statement as millis() can skip values under special conditions AND
- if your code just happens to check 1 millis too late, it skips a meaurement
- It might be wise to remove all floating point operations and store the raw data instead.
floating point operations are emulated on Arduino and costs substantial time.