trying to do moving average with dynamic GYRO_NULL calculation. Most of the code for  version without moving average is there commented.