View Single Post
  #8   Spotlight this post!  
Unread 08-03-2006, 07:14
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Keeping a certain heading using a gyro

Quote:
Originally Posted by devicenull
Also, AFAIK its better to call Get_Gyro_Angle() once. Each time you call it, you shut off interrupts while the code inside it executes.. You want to keep them on as much as possible.

While this probably isn't your idea, don't Reset_Gyro_Angle() before you get the angle.. it will result in getting 0 as an angle
Would something like this work?
Code:
if(i==0){
   Reset_Gyro_Angle();
   i++;
}
and then, store the gyro value into a temporary variable?

Code:
temp_gyro_angle = Get_Gyro_Angle();
__________________