So this program has to turn on the wheels whe the joystick is higher then deadSpace which is 2. The problem is all except MidLeft wheels turn on. What is this. Tried changing ports, everything, only turns on when axis2 (which is right side) turns on.
Left side = front and back only work properly, middle one turns on only if right side is on.
Right side works properly.
Plz help me, am i overlooking something??
Code:
void usercontrol(void){
while(true){
if (abs (ControllerMain.Axis2.value()) >= deadSpace){
Brain.resetTimer();
RearRight.spin(vex::directionType::fwd, ControllerMain.Axis2.value()*.787, vex::velocityUnits::pct);
FrontRight.spin(vex::directionType::fwd, ControllerMain.Axis2.value()*.787, vex::velocityUnits::pct);
MidRight.spin(vex::directionType::fwd, ControllerMain.Axis2.value()*.787, vex::velocityUnits::pct);
}else if (abs(ControllerMain.Axis2.value()) < deadSpace){
if (Brain.timer(vex::timeUnits::msec) >= 240){
RearRight.stop(vex::brakeType::hold);
FrontRight.stop(vex::brakeType::hold);
MidRight.stop(vex::brakeType::hold);
}else{
RearRight.stop(vex::brakeType::coast);
FrontRight.stop(vex::brakeType::coast);
MidRight.stop(vex::brakeType::coast);
}
}
if (abs(ControllerMain.Axis3.value()) >= deadSpace){
Brain.resetTimer();
MidLeft.spin(vex::directionType::fwd, ControllerMain.Axis2.value()*.787, vex::velocityUnits::pct);
FrontLeft.spin(vex::directionType::fwd, ControllerMain.Axis3.value()*.787, vex::velocityUnits::pct);
RearLeft.spin(vex::directionType::fwd, ControllerMain.Axis3.value()*.787, vex::velocityUnits::pct);
}else if (abs(ControllerMain.Axis3.value()) < deadSpace){
if (Brain.timer(vex::timeUnits::msec) >= 240){
RearLeft.stop(vex::brakeType::hold);
FrontLeft.stop(vex::brakeType::hold);
MidLeft.stop(vex::brakeType::hold);
}else{
RearLeft.stop(vex::brakeType::coast);
FrontLeft.stop(vex::brakeType::coast);
MidLeft.stop(vex::brakeType::coast);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(ControllerMain.ButtonR1.pressing()){
Intake.spin(vex::directionType::fwd,100,vex::velocityUnits::pct);
}else if(ControllerMain.ButtonR2.pressing()){
Intake.spin(vex::directionType::rev,100,vex::velocityUnits::pct);
}else{
Intake.stop(vex::brakeType::coast);
}
}
}