How do i Program a Gyroscope With V5


#1

So myself and others are and have been wondering how to program a gyroscope with the new V5 software, thanks for your input and please get back to me as soon as possible.


#2

Do you know how to program a gyro otherwise? If so, these are the methods available in VCS:

vex::gyro.gyro
vex::gyro.value
vex::gyro.startCalibration
vex::gyro.isCalibrating
vex::gyro.changed


#3

This was an example posted by James Pearman not too long ago - :

vex::gyro Gyro1( Brain.ThreeWirePort.C );

int main() {
Brain.Screen.setFont( mono40 );

Gyro1.startCalibration();

while(1) {
      Brain.Screen.printAt( 10, 50, "Gyro %6.1f", Gyro1.value( vex::rotationUnits::deg ) );
      // Allow other tasks to run
      vex::this_thread::sleep_for(50);
     }
}