![]() |
Get_Gyro_Angle() overflows beyond about -20000 deci-decgrees?
I'm trying to make an approximate lap counter by dividing the accumulated gyro angle by 360 (or 3600, since I'm working in decidegrees).
It works up to 5 laps, then the gyro value seems to wrap around to the positive side and start decreasing. I'm using long ints for the calculations. Here is a simplified version of the code.... Code:
long int gyroAngle;Code:
long Get_Gyro_Angle(void) |
Re: Get_Gyro_Angle() overflows beyond about -20000 deci-decgrees?
Quote:
|
Re: Get_Gyro_Angle() overflows beyond about -20000 deci-decgrees?
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) |
Re: Get_Gyro_Angle() overflows beyond about -20000 deci-decgrees?
I've seen the gyro.c,h code in the new 3.0 compatible code. I am using 2.4. Can I just drop the gyro.c,h files into my code and expect everything to be fine? Or are there 3.0/2.4 issues?
|
| All times are GMT -5. The time now is 00:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi