View Single Post
  #1   Spotlight this post!  
Unread 10-02-2006, 22:09
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
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)
{
  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);   

        Camera_Handler();
        Servo_Track();

        printf("%d ",(int)Get_Gyro_Angle());

        Generate_Pwms(pwm13,pwm14,pwm15,pwm16);

        Putdata(&txdata);  
    }
  }
}
Any ideas on this one? Our current bot really needs the gyro for feedback in auto mode. The camera is working fine.