Alright, I don't currently have the code with me so this is an approximation:
Code:
#define GYRO_SCALE(x) ((x) / 360)
/*
* This fixes the Angle overflow problem, so the angle is always in the range
* -360 to 360
*/
float Gyro_FixAngle(float Angle)
{
int Laps = Angle / 360;
return (Angle - (Laps * 360));
}
double PIDGet()
{
return GYRO_SCALE(Gyro_FixAngle(Gyro1->GetAngle()));
}