![]() |
Gyro not working in Autonomous?
The students and I have been banging our head on this one:
Our gyro is working fine during regular operation, but during autonmous mode Get_Gyro_Angle() always returns 0. I've even managed to reduce this down to the fairly minimal code below: Code:
void User_Autonomous_Code(void) |
Re: Gyro not working in Autonomous?
Have you called BOTH Start_Gyro_Bias_Calc() and Stop_Gyro_Bias_Calc() before autonomous executes?
|
Re: Gyro not working in Autonomous?
Quote:
Code:
Initialize_Gyro(); |
Re: Gyro not working in Autonomous?
We are having the same problem, see our symptoms in the gyro code sticky thread. I've also posted the code we are trying to use.
|
Re: Gyro not working in Autonomous?
It's a simple problem to fix:
The call to update the gyro is preformed in Process_Data_From_Local_IO, which is not called during autonomous mode. If you copy the code for it to the User_Autonomous_Code loop, everything will work. To be specific, this code needs to be in your autonomous loop: Code:
if(Get_ADC_Result_Count()) |
Re: Gyro not working in Autonomous?
Devicenull,
YOU ARE AWESOME! I was just getting ready to type a note asking why the Process_data... function might not be running in my code and there was your note! It is very confusing since I've been working with the EDU all summer and it appears to run that function during autonomous. You're a life saver! |
Re: Gyro not working in Autonomous?
Quote:
|
Re: Gyro not working in Autonomous?
I've updated the gyro documentation to make it clear that Process_Gyro_Data( ) needs to be called from User_Autonomous_Code( ). For grins, I also updated the code in frc_gyro.zip.
-Kevin |
| All times are GMT -5. The time now is 09:59. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi