Rev 2018 | Rev 2026 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2018 | Rev 2019 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | 35 | ||
Line 36... | Line 36... | ||
36 | numberOfAxesInRange = 0; |
36 | numberOfAxesInRange = 0; |
37 | 37 | ||
38 | for (axis = PITCH; axis <= YAW; axis++) { |
38 | for (axis = PITCH; axis <= YAW; axis++) { |
39 | if (axis == YAW) |
39 | if (axis == YAW) |
40 | factor = GYRO_SUMMATION_FACTOR_YAW; |
40 | factor = GYRO_OVERSAMPLING_YAW; |
Line 41... | Line 41... | ||
41 | else |
41 | else |
42 | factor = GYRO_SUMMATION_FACTOR_PITCHROLL; |
42 | factor = GYRO_OVERSAMPLING_PITCHROLL; |
43 | 43 | ||
44 | if (rawGyroValue(axis) < 510 * factor) |
44 | if (rawGyroValue(axis) < 510 * factor) |
Line 64... | Line 64... | ||
64 | delay_ms_with_adc_measurement(70, 0); |
64 | delay_ms_with_adc_measurement(70, 0); |
65 | } |
65 | } |
Line 66... | Line 66... | ||
66 | 66 | ||
67 | void gyro_init() { |
67 | void gyro_init() { |
68 | if (gyroAmplifierOffset_readFromEEProm()) { |
68 | if (gyroAmplifierOffset_readFromEEProm()) { |
69 | printf("gyro amp invalid%s", recal); |
69 | printf("gyro amp invalid, recalibrate."); |
70 | gyroAmplifierOffset.offsets[PITCH] = |
70 | gyroAmplifierOffset.offsets[PITCH] = |
71 | gyroAmplifierOffset.offsets[ROLL] = |
71 | gyroAmplifierOffset.offsets[ROLL] = |
72 | gyroAmplifierOffset.offsets[YAW] = (uint8_t)(255 * 1.2089 / 3.0); |
72 | gyroAmplifierOffset.offsets[YAW] = (uint8_t)(255 * 1.2089 / 3.0); |
73 | } else { |
73 | } else { |