Help using a gyro with V5 and VEXcode

Hello, My team has just recently received our V5 equipment and I am trying to learn the programming before the new game comes out. I have just started trying to code the gyro into my program, but I cannot figure out how to properly declare it in vex.h. Any other help for someone coming from cortex transitioning to V5 advice would be appreciated as well.

You don’t need to modify the vex.h file in VEXcode. Just declare objects in the beginning of your program (if you use the competition template to start out you will see a comment showing where to do this. Since VCS and VexCode use the same API and syntax, you can look up any classes/members at Use the VEX C+C Pro.

Here is the gyro page:

Example here:

vex::gyro Gyro( Brain.ThreeWirePort.D);
This would have the Gyro on three wire port D


Thanks. I got it working now. Thanks for your help.

1 Like