Hi. I'm using Kevin's new 2008 code, but I can't figure out how to get the Gyro working in either autonomous mode or user mode. I believe that I set up the code right:
Code:
void Teleop_Init(void)
{
Initialize_Gyro();
if (Get_Gyro_Bias_Status() == GYRO_BIAS_NOT_DONE)
{
Start_Gyro_Bias_Calc();
while (t2 < 76)
{
printf("Calculating gyro bias. State: %d.\n\r", Get_Gyro_Bias_Status());
//Start_Gyro_Bias_Calc();
t2++;
}
Stop_Gyro_Bias_Calc();
printf("Gyro bias calculated: %ld.\n\r", Get_Gyro_Bias());
}
}
Code:
void Teleop(void)
{
...
Process_Gyro_Data();
tmpangle = Get_Gyro_Angle();
printf("Gyro Angle %d\n\r", tmpangle);
...
}
But unfortunately, the only output I get is "Gyro Angle 0". I'm sure I've got the gyro connected right, as I get values from Get_Analog_Value (and they change), but I don't get anything from Kevin's code. Can anyone help?