DT Reverse

Is there a way that I can press a button and the drive train reverses. I want to press a button and then when I push the sticks forward it goes backwards.

I would recommend multiplying your drivetrain speed by a variable. Set the variable to 1 and change it to -1 when you push a button.

3 Likes

ok could you make like an example in python because I am not the best at variable code

I beileve something like this will work. A and B are variables used in determining speed of the wheels.

Reversed = False

 if controller_1.buttonA.pressing():
            if Reversed == False:
                Reversed = True
            if Reversed == True:
                Reversed = False
 elif Reversed == True:
            A = -A
            B = -B
 if Reversed == False:
            A = A
            B = B
1 Like