Driver control joysticks not working in PROS

Hey guys! We’ve recently switched to PROS after using VexCode Blocks and we’re trying to program a tank drive using two motors. The only thing is the drivetrain doesn’t move when we run the program. The intakes and outakes do work. Here’s our code.
#include “main.h”

void setDrive(int left, int right){
left = left;
right = right;
}

void setDriveMotors(){
int leftJoystick = controller.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y);
int rightJoystick = controller.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_Y);

if (abs(leftJoystick) < 10)
leftJoystick = 0;
if (abs(rightJoystick) < 10)
rightJoystick = 0;
setDrive(leftJoystick, rightJoystick);
}

void opcontrol() {
while (true) {
	setDriveMotors();
	setIntakeMotors();
	setOutakeMotors();

	pros::delay(10);
}

}

Please Heeeelp!!!

2 Likes

In PROS, you have to define your motors and then do motor.move(insert speed here). All you’re doing is defining variables. If the intakes work fine, then you basically just need to do the same thing for the drivetrain except make it based off the variables you defined.

Look at your setDrive function. You’re quite literally just setting left to be itself and right to be itself.

4 Likes