We use Vex Coding Studio with our V5 setup. This is our first year doing so and I know it is recommended that we not use VCS but this is not an option for us right now.
My students are trying to get their robots functional and one group can’t figure out why their right motor will not operate from the joystick. Instead, it will run from the “A” button on the same joystick. We have tried a different controller and the results are still the same. Any help you can give is greatly appreciated!
#include "robot-config.h"
int main() {
//Display that the program has started to the screen.
Brain.Screen.print("Tank Control Program Started");
int clawSpeedPCT = 50;
while(1) {
Left.spin(vex::directionType::fwd, Controller1.Axis2.value(), vex::velocityUnits::pct);
Right.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct);
// Arm.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct);
// Elbow.spin(vex::directionType::fwd, Controller1.Axis2.value(), vex::velocityUnits::pct);
if (Controller1.ButtonR1.pressing())
{
Claw.spin(vex::directionType::fwd, clawSpeedPCT, vex::velocityUnits::pct);
}
else if(Controller1.ButtonR2.pressing())
{
//...Spin the claw motor backward.
Claw.spin(vex::directionType::rev, clawSpeedPCT, vex::velocityUnits::pct);
}
else
{
Claw.stop(vex::brakeType::brake);
}
vex::task::sleep(20); //Sleep the task for a short amount of time to prevent wasted resources.
}
}