Quote:
|
Originally Posted by jaustin
Ok guys, here is my gyro "issue"...
|
Re-reading your post, I realized that you're reaching deep into the code and looking at half-baked data. The variable gyro_angle is just a summation of all of the preceeding gyro rate measurements and won't make sense until you examine the return value of Get_Gyro_Angle( ). Here's the function:
long Get_Gyro_Angle(void)
{
// Return the calculated gyro angle to the caller.
return(((gyro_angle * GYRO_SENSITIVITY *5L) / (ADC_RANGE * ADC_UPDATE_RATE)) * GYRO_CAL_FACTOR);
}
I only calculate the angle "on demand" to keep the load on the microcontroller to a minimum.
BTW, I've spent quite a bit of time in Mukilteo -- mostly waiting for the ferry to Whidbey Island <grin>.
-Kevin