My robot is not driving and I have tried so many different options such as checking what ports they are connected to, or checking my controlller connection. The autnomous will work just fine but whenever I try to drive to via controller, it will not move.
from vex import *
# Brain should be defined by default
b = Brain()
c = Controller()
lt = Motor(Ports.PORT4, GearSetting.RATIO_6_1, False)
lb = Motor(Ports.PORT1, GearSetting.RATIO_6_1, True)
rt = Motor(Ports.PORT3, GearSetting.RATIO_6_1, True)
rb = Motor(Ports.PORT2, GearSetting.RATIO_6_1, False)
it = Motor(Ports.PORT5, GearSetting.RATIO_6_1, True)
arm = Motor(Ports.PORT6, GearSetting.RATIO_6_1, True)
lp = Pneumatics(b.three_wire_port.a)
rp = Pneumatics(b.three_wire_port.a)
lt.spin(FORWARD, c.axis2.position(), PERCENT)
lb.spin(FORWARD, c.axis2.position(), PERCENT)
rt.spin(FORWARD, c.axis3.position(), PERCENT)
rb.spin(FORWARD, c.axis3.position(), PERCENT)
def move (direction, speed):
lt.spin(direction, speed, PERCENT)
lb.spin(direction, speed, PERCENT)
rt.spin(direction, speed, PERCENT)
rb.spin(direction, speed, PERCENT)
def stop():
lt.stop(BRAKE)
lb.stop(BRAKE)
rt.stop(BRAKE)
rb.stop(BRAKE)
def turn (direction1, velocity1, direction2, velocity2):
# Left side motors
lt.spin(direction1, velocity1, RPM)
lb.spin(direction1, velocity1, PERCENT)
# Right side motors
rt.spin(direction2, velocity2, PERCENT)
rb.spin(direction2, velocity2, PERCENT)
def climb():
lp.open()
rp.open()
def autonomous():
turn(FORWARD, 100, FORWARD, 50)
wait(200)
stop()
def drive():
# Drive
lt.spin(FORWARD, c.axis2.position(), PERCENT)
lb.spin(FORWARD, c.axis2.position(), PERCENT)
rt.spin(FORWARD, c.axis3.position(), PERCENT)
rb.spin(FORWARD, c.axis3.position(), PERCENT)
comp = Competition(drive, autonomous)