I am trying to make my robot speed up and slow down by pushing a button on the controller (ButtonX). I want it where pushing it once speeds it up to normal speed, then pushing it again causes it to slow down to half speed. This is what I have so far, but I am lost how to get continue the code. I am using VexCode Text with the new V5 smart motors.
I also can not figure out how to change drive speed, I can change the speed of the claw and other parts of my robot, but not the drive speed. If you have any way to slow down the speed that would also be helpful. I can not find any resources online that tell me how to do it. This is the code I used to change the speed of the arm, but I can not put in the speed because I need the variable for the controller for the wheels:
This code will make the robot move at half speed when a button is pressed down, and it will move at full speed when it is not.
You can change the speed of the drive by updating a variable, equal to the axis of the joystick.
You just need to create another variable. I’d suggest looking at some more examples from vex, as I get the impression you’re new to C.