Rev 1864 | Rev 1869 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1864 | Rev 1866 | ||
---|---|---|---|
Line 445... | Line 445... | ||
445 | 445 | ||
446 | case 17: |
446 | case 17: |
447 | // Battery. The measured value is: (V * 1k/11k)/3v * 1024 = 31.03 counts per volt (max. measurable is 33v). |
447 | // Battery. The measured value is: (V * 1k/11k)/3v * 1024 = 31.03 counts per volt (max. measurable is 33v). |
448 | // This is divided by 3 --> 10.34 counts per volt. |
448 | // This is divided by 3 --> 10.34 counts per volt. |
449 | UBat = (3 * UBat + sensorInputs[AD_UBAT] / 3) / 4; |
449 | UBat = (3 * UBat + sensorInputs[AD_UBAT] / 3) / 4; |
450 | DebugOut.Analog[11] = HIRES_GYRO_INTEGRATION_FACTOR;//UBat; |
450 | DebugOut.Analog[11] = UBat; |
451 | analogDataReady = 1; // mark |
451 | analogDataReady = 1; // mark |
452 | ADCycleCount++; |
452 | ADCycleCount++; |
453 | // Stop the sampling. Cycle is over. |
453 | // Stop the sampling. Cycle is over. |
454 | state = 0; |
454 | state = 0; |
Line 491... | Line 491... | ||
491 | deltaOffsets[axis] += rawGyroSum[axis]; |
491 | deltaOffsets[axis] += rawGyroSum[axis]; |
492 | } |
492 | } |
493 | } |
493 | } |
Line 494... | Line 494... | ||
494 | 494 | ||
495 | for (axis = PITCH; axis <= YAW; axis++) { |
495 | for (axis = PITCH; axis <= YAW; axis++) { |
496 | gyroOffset[axis] = (deltaOffsets[axis] + GYRO_OFFSET_CYCLES / 2) |
- | |
497 | / GYRO_OFFSET_CYCLES; |
496 | gyroOffset[axis] = (deltaOffsets[axis] + GYRO_OFFSET_CYCLES / 2) / GYRO_OFFSET_CYCLES; |
498 | DebugOut.Analog[20 + axis] = gyroOffset[axis]; |
497 | // DebugOut.Analog[20 + axis] = gyroOffset[axis]; |
Line 499... | Line 498... | ||
499 | } |
498 | } |
500 | 499 |