It says Error main.cpp (4, 10) What does that Mean?

void usercontrol(void){
    
    
    while(true) {
        LeftFront.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct); //(Axis3+Axis4)/2
        RightFront.spin(vex::directionType::fwd, Controller1.Axis2.value(), vex::velocityUnits::pct);//(Axis3-Axis4)/2
        
        vex::task::sleep(20); 
    }
        
  
       

    //Use these variables to set the speed of the arm and claw.
    int armSpeedPCT = 50;
    int clawSpeedPCT = 50;

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

        if(Controller1.ButtonR2.pressing()) {
            Claw.spin(directionType::fwd, clawSpeedPCT, velocityUnits::pct);
        }
        else if(Controller1.ButtonR2.pressing()) {
            Claw.spin(directionType::rev, clawSpeedPCT, velocityUnits::pct);
        }
        else {
            Claw.stop(brakeType::brake);        
        }

        task::sleep(20);
    }

}

 int main() {

    int armSpeedPCT = 50;
    int clawSpeedPCT = 50;

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

        if(Controller1.ButtonR1.pressing()) {
            Claw1.spin(directionType::fwd, clawSpeedPCT, velocityUnits::pct);
        }
        else if(Controller1.ButtonR1.pressing()) {
            Claw1.spin(directionType::rev, clawSpeedPCT, velocityUnits::pct);
        }
        else {
            Claw1.stop(brakeType::brake);        
        }

        task::sleep(20);
    }

}

      
      
      
   
       
    // ........................................................................
    // Insert user code here. This is where you use the joystick values to 
    // update your motors, etc.
    // ........................................................................

error main.cpp(4,10) means there is an error in the file main.cpp at line 4, column 10.

Is what you posted above the complete contents of main.cpp? Usually there is some boilerplate (#include statements, etc.) at the top of the file.

There is usually also some additional content in the “output” tab in VEXcode that gives you some information about what the error is, rather than just where it is in the file.

5 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.