Rev 2122 | Rev 2125 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2122 | Rev 2124 | ||
---|---|---|---|
Line 410... | Line 410... | ||
410 | int32_t offsets[4] = { 0, 0, 0, 0 }; |
410 | int32_t offsets[4] = { 0, 0, 0, 0 }; |
411 | gyro_calibrate(); |
411 | gyro_calibrate(); |
Line 412... | Line 412... | ||
412 | 412 | ||
413 | // determine gyro bias by averaging (requires that the aircraft does not rotate around any axis!) |
413 | // determine gyro bias by averaging (requires that the aircraft does not rotate around any axis!) |
414 | for (i = 0; i < OFFSET_CYCLES; i++) { |
414 | for (i = 0; i < OFFSET_CYCLES; i++) { |
415 | delay_ms_with_adc_measurement(2, 1); |
415 | delay_ms_with_adc_measurement(4, 1); |
416 | for (axis = PITCH; axis <= YAW; axis++) { |
416 | for (axis = PITCH; axis <= YAW; axis++) { |
417 | offsets[axis] += rawGyroValue(axis); |
417 | offsets[axis] += rawGyroValue(axis); |
418 | } |
418 | } |
419 | offsets[3] += sensorInputs[AD_AIRPRESSURE]; |
419 | offsets[3] += sensorInputs[AD_AIRPRESSURE]; |