View Single Post
  #6   Spotlight this post!  
Unread 02-02-2012, 10:36
neal's Avatar
neal neal is offline
Neal
FRC #1777 (Viking Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: United States
Posts: 56
neal is an unknown quantity at this point
Re: New to FRC programming... How does this look?

Like omalleyj said, resetting gyro in the loop isn't a good way, especially when it's moving.

I would do something simple like this:

Code:
// Reset gyro before the main loop, or with a button.
double angle = gyro.getAngle();
if (angle < 90) {
    drivetrain.drive(0.0, 0.15); // I don't know how turn works, I've only done tank drive and mecanum drive in the past.
}
Reply With Quote