Gyrometer and Arcade Control Help


Does anyone know how to code a gyro sensor into your program and how to code arcade control on your left joystick? If anyone could tell me what exactly I could use the pyrometer for that would be awesome!


Are you using the VEX CORTEX or VEX V5? What coding platform?


What exactly do you need help with when it comes to the gyroscope? And what do you want your joystick to do (strictly forward and backward motion, include turning)?


@[TVA]Connor and @Kselva20, Our robot is a V5 robot. We want to figure out how to turn. We want it to turn so we can hit flags more effectively in autonomous! We do not need it to go back and forth, if you could tell us that it would be awesome. More info the merrier!!!


The following code is for forward and backward motion with the left joystick and turning with the right joystick.

int leftSpeedMainUser = int(MainUser.Axis3.position(vex::percentUnits::pct)) + ((MainUser.Axis1.position(vex::percentUnits::pct)) + (MainUser.Axis2.position(vex::percentUnits::pct)));
        int rightSpeedMainUser = int(MainUser.Axis3.position(vex::percentUnits::pct)) - ((MainUser.Axis1.position(vex::percentUnits::pct)) + (MainUser.Axis2.position(vex::percentUnits::pct)));
        int leftSpeedSecondUser = int(SecondUser.Axis3.position(vex::percentUnits::pct)) + ((SecondUser.Axis1.position(vex::percentUnits::pct)) + (SecondUser.Axis2.position(vex::percentUnits::pct)));
        int rightSpeedSecondUser = int(SecondUser.Axis3.position(vex::percentUnits::pct)) - ((SecondUser.Axis1.position(vex::percentUnits::pct)) + (SecondUser.Axis2.position(vex::percentUnits::pct)));
        if(leftSpeedSecondUser > 30 or leftSpeedSecondUser < -30){
        else if(leftSpeedMainUser > 10 or leftSpeedMainUser < -10){
        if(rightSpeedSecondUser > 30 or rightSpeedSecondUser < -30){
        else if(rightSpeedMainUser > 10 or rightSpeedMainUser < -10){

As for the gyroscope, you use it as any other sensor. You should calibrate it for 5 seconds by using the startCalibration method and then the vex task sleep method. Then, the gyroscope start from 0 and going immediately to right will make the values positive and the left will make them negative. There is no way to zero the gyroscope. To obtain the current value of the gyroscope, use the analogUnits with the data type of range12bit. This will return the value in tenths of a degree, so 180 degrees equals 1800 . If you have any other questions feel free to ask. I hope this helped.


@[TVA]Connor V5