VexCode Motor only runs with both sticks

I made a driving code in vexcode, and the front right wheel only turns with both of the joysticks. All other wheels work as they should. The last wheel needs both joysticks to be forward to move.

#include "vex.h"

using namespace vex;

vex::brain Brain;
vex::controller Controller;

vex::motor FrontLeft = vex::motor(vex::PORT1, false);
vex::motor FrontRight = vex::motor(vex::PORT2, true);
vex::motor BackLeft = vex::motor(vex::PORT3, false);
vex::motor BackRight = vex::motor(vex::PORT4, true);

int main() {
  while(true) {
    
    //front left wheel
    if(abs(Controller.Axis3.value()) > 10) {
      FrontLeft.spin(vex::directionType::fwd, Controller.Axis3.position(), vex::velocityUnits::pct);
    }
    else {
      FrontRight.stop(vex::brakeType::coast);
    }

    //back left wheel
    if(abs(Controller.Axis3.value()) > 10) {
      BackLeft.spin(vex::directionType::fwd, Controller.Axis3.position(), vex::velocityUnits::pct);
    }
    else {
      BackLeft.stop(vex::brakeType::coast);
    }

    //front right wheel
    if(abs(Controller.Axis2.value()) > 10) {
      FrontRight.spin(vex::directionType::fwd, Controller.Axis2.position(), vex::velocityUnits::pct);
    }
    else {
      FrontRight.stop(vex::brakeType::coast);
    }

    //back right wheel
    if(abs(Controller.Axis2.value()) > 10) {
      BackRight.spin(vex::directionType::fwd, Controller.Axis2.position(), vex::velocityUnits::pct);
    }
    else {
      BackRight.stop(vex::brakeType::coast);
    }
  }
}

Look at your code for the front left wheel, it is saying for front right wheel to stop, fix that then try it.

1 Like

Since @James6555 solved your problem, I want to mention that you don’t need four if statements for this purpose. You can make one for each side (keeping the condition and putting both motors in the same place)