It did not work, here is my whole code
#include "vex.h"
using namespace vex;
using signature = vision::signature;
using code = vision::code;
// A global instance of brain used for printing to the V5 Brain screen
brain Brain;
// VEXcode device constructors
controller Controller1 = controller(primary);
motor leftMotorA = motor(PORT1, ratio18_1, false);
motor leftMotorB = motor(PORT10, ratio18_1, false);
motor_group LeftDriveSmart = motor_group(leftMotorA, leftMotorB);
motor rightMotorA = motor(PORT11, ratio18_1, true);
motor rightMotorB = motor(PORT20, ratio18_1, true);
motor_group RightDriveSmart = motor_group(rightMotorA, rightMotorB);
drivetrain Drivetrain = drivetrain(LeftDriveSmart, RightDriveSmart, 319.19, 295, 40, mm, 1);
motor Motor19 = motor(PORT19, ratio18_1, false);
motor Motor5 = motor(PORT5, ratio18_1, true);
motor Motor6 = motor(PORT6, ratio36_1, false); //Copy replace 6 with 7
motor Motor7 = motor(PORT7, ratio36_1, true);
// VEXcode generated functions
// define variable for remote controller enable/disable
bool RemoteControlCodeEnabled = true;
// define variables used for controlling motors based on controller inputs
bool Controller1RightShoulderControlMotorsStopped = true;
bool Controller1LeftShoulderControlMotorsStopped = true;
bool Controller1RightArrowDriveSwitchTank = false;
bool Controller1RightArrowDriveSwitchArcade= true;
bool DrivetrainLNeedsToBeStopped_Controller1 = true;
bool DrivetrainRNeedsToBeStopped_Controller1 = true;
bool slowMode = false;
// define a task that will handle monitoring inputs from Controller1
int rc_auto_loop_function_Controller1() {
// process the controller input every 20 milliseconds
// update the motors based on the input values
while(true) {
if(RemoteControlCodeEnabled) {
// calculate the drivetrain motor velocities from the controller joystick axies
// left = Axis3 + Axis1
// right = Axis3 - Axis1
//Arcade Drive
int drivetrainLeftSideSpeed = Controller1.Axis3.position() + Controller1.Axis1.position();
int drivetrainRightSideSpeed = Controller1.Axis3.position() - Controller1.Axis1.position();
int speedLeft = drivetrainLeftSideSpeed;
int speedRight = drivetrainRightSideSpeed;
// int drivetrainLeftSideSpeed = Controller1.Axis3.position();
// int drivetrainRightSideSpeed = Controller1.Axis2.position();
// check if the value is inside of the deadband range
if (speedLeft < 5 && speedLeft > -5) {
// check if the left motor has already been stopped
if (DrivetrainLNeedsToBeStopped_Controller1) {
// stop the left drive motor
LeftDriveSmart.stop();
// tell the code that the left motor has been stopped
DrivetrainLNeedsToBeStopped_Controller1 = false;
}
} else {
// reset the toggle so that the deadband code knows to stop the left motor nexttime the input is in the deadband range
DrivetrainLNeedsToBeStopped_Controller1 = true;
}
// check if the value is inside of the deadband range
if (speedRight < 5 && speedRight > -5) {
// check if the right motor has already been stopped
if (DrivetrainRNeedsToBeStopped_Controller1) {
// stop the right drive motor
RightDriveSmart.stop();
// tell the code that the right motor has been stopped
DrivetrainRNeedsToBeStopped_Controller1 = false;
}
} else {
// reset the toggle so that the deadband code knows to stop the right motor next time the input is in the deadband range
DrivetrainRNeedsToBeStopped_Controller1 = true;
}
// only tell the left drive motor to spin if the values are not in the deadband range
if (DrivetrainLNeedsToBeStopped_Controller1) {
LeftDriveSmart.setVelocity(speedLeft, percent);
LeftDriveSmart.spin(forward);
}
// only tell the right drive motor to spin if the values are not in the deadband range
if (DrivetrainRNeedsToBeStopped_Controller1) {
RightDriveSmart.setVelocity(speedRight, percent);
RightDriveSmart.spin(forward);
}
// check the ButtonR1/ButtonR2 status to control Motor19
if (Controller1.ButtonR2.pressing()) {
Motor19.spin(directionType::fwd, 75, velocityUnits::rpm);
Motor5.spin(directionType::fwd, 75, velocityUnits::rpm);
Controller1RightShoulderControlMotorsStopped = false;
} else if (Controller1.ButtonR1.pressing()) {
Motor19.spin(directionType::rev, 75, velocityUnits::rpm);
Motor5.spin(directionType::rev, 75, velocityUnits::rpm);
Controller1RightShoulderControlMotorsStopped = false;
} else if (!Controller1RightShoulderControlMotorsStopped) {
Motor19.stop();
Motor5.stop();
// set the toggle so that we don't constantly tell the motor to stop when the buttons are released
Controller1RightShoulderControlMotorsStopped = true;
}
else if (Controller1.ButtonL2.pressing()) {
printf("Test");
Motor6.spin(directionType::fwd, 50, velocityUnits::rpm);
Motor7.spin(directionType::fwd, 50, velocityUnits::rpm);
Controller1LeftShoulderControlMotorsStopped = false;
} else if (Controller1.ButtonL1.pressing()) {
Motor6.spin(directionType::rev, 50, velocityUnits::rpm);
Motor7.spin(directionType::rev, 50, velocityUnits::rpm);
Controller1LeftShoulderControlMotorsStopped = false;
} else if (!Controller1LeftShoulderControlMotorsStopped) {
Motor6.stop();
Motor7.stop();
// set the toggle so that we don't constantly tell the motor to stop when the buttons are released
Controller1LeftShoulderControlMotorsStopped = true;
}
//Switches
bool bDriveModeTank = false;
bool bRightButtonWasPressing = false;
bool bSlowDriveMode = Controller1.ButtonY.pressing();
if( Controller1.ButtonRight.pressing() &&
!bRightButtonWasPressing ) // you only want to catch it once
{
bDriveModeTank = ! bDriveModeTank; // flip the drive mode
}
// remember for the next iteration
bRightButtonWasPressing = Controller1.ButtonRight.pressing();
if( bDriveModeTank == true )
{
drivetrainLeftSideSpeed = Controller1.Axis3.position();
drivetrainRightSideSpeed = Controller1.Axis2.position();
}
else // Arcade
{
drivetrainLeftSideSpeed = Controller1.Axis3.position() + Controller1.Axis1.position();
drivetrainRightSideSpeed = Controller1.Axis3.position() - Controller1.Axis1.position();
}
if(bSlowDriveMode == true)
{
speedLeft = drivetrainLeftSideSpeed / 2;
speedRight = drivetrainRightSideSpeed / 2;
}
//Auto Lift
}
// wait before repeating the process
wait(20, msec);
}
return 0;
}
/**
* Used to initialize code/tasks/devices added using tools in VEXcode Pro.
*
* This should be called at the start of your int main function.
*/
void vexcodeInit( void ) {
task rc_auto_loop_task_Controller1(rc_auto_loop_function_Controller1);
}