multiwii / baseflight

32 bit fork of the MultiWii RC flight controller firmware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sensor calibration code

teyann opened this issue · comments

Hello. I had a question than at the ACC_Common function in the file of sensor.c baseflight source code.

'a[ROLL] + (CALIBRATING_ACC_CYCLES / 2)) / CALIBRATING_ACC_CYCLES'

The above source code, not the source code to calculate the average. The above source code is average + '1/2'

So I wonder why that code is written like that.

commented

rounding

Haha, I forgot that.
Thanks