V5 gyro sensor with python

would anyone happen to have any code that would allow me to run the gyro with the v5 through the legacy ports in python, thanks in advance

Here you go. There’s not much to it.

1 Like

how would i do that in auton

Put the code dealing with the gyro inside the autonomous function when using the competition template. You can either check the box for a competition template when making a new project, or use this pared down version:

# VEX V5 Python Project with mini-competition Template
import sys
import vex
from vex import *
#region config
#endregion config
competition = vex.Competition()
def pre_auton():
    pass
def autonomous():
    #put your autonomous code here
    pass
def drivercontrol():
    while True:
        pass
competition.autonomous(autonomous)
competition.drivercontrol(drivercontrol)
pre_auton()
1 Like