View Single Post
  #4   Spotlight this post!  
Unread 21-04-2013, 22:41
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Off Season Experimentation

I see two issues with the code you posted. First, it only runs once. In order for it to do what you want, reading the Gyro angle and setting the motor speeds need to be inside a While loop. Second, you're checking for exactly 90 degrees, and that's a very unlikely number. Try stopping the motors after it has turned at least 90 degrees; that way you won't fail to stop because you miss the brief instant when it's right at 90 degrees.
Reply With Quote