if (reversing) { //Put whatever code you use to detect if you're reversing here myMotor.set(-joystick.getYAxis()); //Set a motor to the inverse of the Y axis. }