Motors wont spin quickly

When I move the motors between the ports, they change speeds. This lead me to the conclusion that I thought something was wrong with my code, but I see no issues. Changing the speed values doesn’t do anything. Could someone help me out?

// Include the V5 Library
#include “vex.h”

int main() {

while(true) {
LeftDriveSmart.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct);
RightDriveSmart.spin(vex::directionType::fwd, Controller1.Axis2.value(), vex::velocityUnits::pct);//(Axis3-Axis4)/2

   vex::task::sleep(20);

}

int armSpeedPCT = 100;
int clawSpeedPCT = 100;

while(true) {
if(Controller1.ButtonUp.pressing()) {
ArmMotor.spin(directionType::fwd, armSpeedPCT, velocityUnits::pct);
}
else if(Controller1.ButtonDown.pressing()) {
ArmMotor.spin(directionType::rev, armSpeedPCT, velocityUnits::pct);
}
else {
ArmMotor.stop(brakeType::brake);
}

   if(Controller1.ButtonA.pressing()) {
       ClawMotor.spin(directionType::fwd, clawSpeedPCT, velocityUnits::pct);
   }
   else if(Controller1.ButtonY.pressing()) {
       ClawMotor.spin(directionType::rev, clawSpeedPCT, velocityUnits::pct);
   }
   else {
       IntakeMotor.stop(brakeType::brake);       
   }
   if(Controller1.ButtonX.pressing()) {
       IntakeMotor.spin(directionType::fwd, clawSpeedPCT, velocityUnits::pct);
   }
   else if(Controller1.ButtonB.pressing()) {
       IntakeMotor.spin(directionType::rev, clawSpeedPCT, velocityUnits::pct);
   }
   else {
       IntakeMotor.stop(brakeType::brake);       
   }


   task::sleep(20);

}

}

That could be a brain issue
(Wait for more experienced users than me to take action though)

In your else, did you mean to set ClawMotor.stop(brakeType::brake); instead of the IntakeMotor?

I think what’s happening is your IntakeMotor is being set to brake and move at the same time. When no button is pressed, theIntakeMotor is stopped. But when you press X or B (while A and Y aren’t pressed), the motor is being set to clawSpeedPCT and brake at the same time.

5 Likes

I looked through your code and didn’t see anything that stood out as wrong (i could have missed something). have you tried trouble shooting the problem by switching brains, trying different motor configurations on your code, trying different programs, changing out motors, changing out wires, etc.? if not, i would definitely suggest doin that and report your findings here so we can better solve the problem.