View Single Post
  #1   Spotlight this post!  
Unread 09-03-2004, 19:15
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Question Wierd gyro code problems...pls help

Hi, i've coded a VERY simple code for a gyro ..... the gyro outputs 10bits so i shifted 2....but now the gyro stays at 135 even when not moving or being shaked etc... I can't figure out the problem...the gyro is working (we monitored voltage)

can you please read the code and help thank you
Code:
gyro1=rc_ana_in01;
2<<gyro1;
if(gyro1>136)
{
heading++;
}
if(gyro1<119)
{
heading=heading-1;
}


if(mode==1)
{

if(heading<turn+error) 
{
pwm01=184;
pwm02=70;
}
if(heading>turn-error)   //error is a tolerance!!!! i set it to 400
{
pwm01=70;
pwm02=184;
}
}

Thank You
Salik Syed Team 701
btw we are using the BEI gyro from 2k3 (we know...its not allowed...we'll get another gyro soon)
__________________
Team 701