Ok, here is the latest updates from our Attempts at getting a signal from the Gyro. Here is all our autonomous code is:
Code:
//VARIABLES DECALARED AT TOP
unsigned long int gyro_input;
void User_Autonomous_Code(void)
{
/* Initialize all PWMs and Relays when entering Autonomous mode, or else it
will be stuck with the last values mapped from the joysticks. Remember,
even when Disabled it is reading inputs from the Operator Interface.
*/
pwm01 = pwm02 = pwm03 = pwm04 = pwm05 = pwm06 = pwm07 = pwm08 = 127;
pwm09 = pwm10 = pwm11 = pwm12 = pwm13 = pwm14 = pwm15 = pwm16 = 127;
relay1_fwd = relay1_rev = relay2_fwd = relay2_rev = 0;
relay3_fwd = relay3_rev = relay4_fwd = relay4_rev = 0;
relay5_fwd = relay5_rev = relay6_fwd = relay6_rev = 0;
relay7_fwd = relay7_rev = relay8_fwd = relay8_rev = 0;
while (autonomous_mode) /* DO NOT CHANGE! */
{
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */
gyro_input = Get_Analog_Value(rc_ana_in01);
printf("gyro: %d",(int)gyro_input);
Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}
}
}
And we get in out output from the printf "Gyro: 0". I can't make it any simpler! and its absolutly driving me up a wall! What could possible be wrong other then our FRC hates me and is broken in some way....does anyone out there have any thoughts on why this thing might still not work. Even if its something incredibly simple that you assume all teams should know please tell. Thanks again.
I also remember right before the 2004 competition FIRST released an unpdate for the controller that we never did.... did that have anything to do with analog inputs?
PS. Currently we are meeting after school on Fridays @ 2:00pm, and we sometimes meet during the week just to work on some small things, so if we cant get it working soon maby it would be best if you stop by and have someone who really knowns what they are doing (ie. not ne one from our team) look at it.