|
Re: New C18 3.0+ Compatible FRC Code
Quote:
Originally Posted by sumadin
Kevin,
What is the procedure for adding additional analog sensors with the gyro code? I changed the number of ADC channels, plugged the (pots, in my case) in to channels 2 and 3, and added the code to read them in the Process_Gyro_Data function.
..the gyro has since been going crazy. I wired the gyro to an oscilloscope, and it still works, but the code (after given time to initialize and computing the bias) sees crazy values ...
Thanks.
|
Just a thought, here is a quote from the header of the gyro.c/Process_Gyro_Data
Code:
FUNCTION: Process_Gyro_Data()
*
* PURPOSE: Manages ADC data and does gyro rate integration
*
* CALLED FROM: ifi_frc.c/Disabled_Spin(),
* ifi_frc.c/Autonomous_Spin(),
* ifi_frc.c/Teleop_Spin()
*
* PARAMETERS: Unsigned char with a value of zero will prevent this
* function from calling Reset_ADC_Result_Count() when
* ADC data has been processed. If you do use this mode
* of operation you must call Reset_ADC_Result_Count()
* from your own code. Failure to do this will cause
* the gyro to stop functioning.
Are you calling Reset_ADC_Result_Count() from your code?
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
|