Okay, I'll check out Kevin's newer code....
BTW, for my current code I dereferenced the macros and got
Code:
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);
// translates to:
//return(((gyro_angle * 800L * 5L) / (1024L * ADC_SAMPLE_RATE/(ADC_SAMPLES_PER_UPDATE * NUM_ADC_CHANNELS))) * 958/1000);
// which translates to ...
//return(((gyro_angle * 800L * 5L) / (1024L * 200/(4 * 1))) * 958/1000);
}
I guess I could make my own Get_Gyro_Angle_Low_Resolution() that doesn't use such a large value for GYRO_SENSITIVITY.
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the
USPTO.
My favorite error message from gcc:
main is usually a function
My favorite error message from Windows:
There is not enough disk space available to delete this file.