/*----------------------------------------------------------------------------*/
/* */
/* Module: main.cpp */
/* Author: 10 Fusion */
/* Created: Mon Jul 15 2019 */
/* Description: VRC Robot Code 2019-2020 */
/* */
/*----------------------------------------------------------------------------*/
#include "vex.h"
// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name] [Type] [Port(s)]
// lFront motor 2
// lBack motor 3
// rFront motor 4
// rBack motor 5
// leftLift motor 6
// rightLift motor 7
// rightIntake motor 8
// leftIntake motor 9
// ---- END VEXCODE CONFIGURED DEVICES ----
using namespace vex;
//Documentationj
//All unit lengths are in inches
//Global Variables
int threshold = 10; //Threshold for both joysticks
int x = Controller.Axis4.position(percentUnits::pct); //Left Joystick X-Axis
int y = Controller.Axis3.position(percentUnits::pct); //Left Joystick Y-Axis
int ry = Controller.Axis2.position(percentUnits::pct); //Right Joystick Y-Axis
double mDegrees;
int suppAngle;
//Driver control functions
//Drive function
void arcadeDrive(int sensitivity) {
if(abs(x) < threshold) x = 0;
if(abs(y) < threshold) y = 0;
int senseX = pow(x/100, sensitivity) * 100;
int senseY = pow(y/100, sensitivity) * 100;
lFront.spin(directionType::fwd, senseY + senseX, velocityUnits::pct);
lBack.spin(directionType::fwd, senseY + senseX, velocityUnits::pct);
rFront.spin(directionType::fwd, senseY - senseX, velocityUnits::pct);
rBack.spin(directionType::fwd, senseY - senseX, velocityUnits::pct);
}
void intakeFwd(int intakeSpeed) {
leftIntake.spin(directionType::fwd, intakeSpeed, velocityUnits::pct);
rightIntake.spin(directionType::fwd, intakeSpeed, velocityUnits::pct);
}
void intakeRev(int intakeSpeed) {
leftIntake.spin(directionType::rev, intakeSpeed, velocityUnits::pct);
rightIntake.spin(directionType::rev, intakeSpeed, velocityUnits::pct);
}
//Lift function
void lift(/*int liftSpeed*/) {
//testing
//int liftMax = LiftPot.value(percentUnits::pct);
/*if(Controller.ButtonA.pressing()) {
while(liftMax > 0 && liftMax < 75) {
leftLift.spin(vex::directionType::fwd, liftSpeed, velocityUnits::pct);
rightLift.spin(vex::directionType::fwd, liftSpeed, velocityUnits::pct);
}
}*/
if(abs(ry) < threshold) xy = 0;
leftLift.spin(directionType::fwd, ry, velocityUnits::pct);
rightLift.spin(directionType::fwd, ry, velocityUnits::pct);
}
//Intake function
void intake(int intakeSpeed) {
Controller.ButtonR1.pressed(intakeFwd(intakeSpeed));
Controller.ButtonL1.pressed(intakeRev(intakeSpeed));
/*if(Controller.ButtonA.pressed()} {
}
else if(Controller.ButtonB.pressed()) {
}*/
}
//Autonomous movement functions
void moveForward(int distance) {
mDegrees = (distance/(4*M_PI)) * 360;
lFront.startRotateFor(directionType::fwd, mDegrees, rotationUnits::deg, false);
lBack.startRotateFor(directionType::fwd, mDegrees, rotationUnits::deg, false);
rFront.startRotateFor(directionType::fwd, mDegrees, rotationUnits::deg, false);
rBack.startRotateFor(directionType::fwd, mDegrees, rotationUnits::deg, false);
}
void moveBackward(int distance) {
mDegrees = (distance/(4*M_PI)) * 360;
lFront.startRotateFor(directionType:rev, mDegrees, rotationUnits::deg, false);
lBack.startRotateFor(directionType::rev, mDegrees, rotationUnits::deg, false);
rFront.startRotateFor(directionType::rev, mDegrees, rotationUnits::deg, false);
rBack.startRotateFor(directionType::rev, mDegrees, rotationUnits::deg, false);
}
void turnRight(int degrees) {
suppAngle = 180 - degrees;
lFront.startRotateFor(directionType::fwd, mDegrees, rotationUnits::deg, false);
lBack.startRotateFor(directionType::fwd, mDegrees, rotationUnits::deg, false);
rFront.startRotateFor(directionType::rev, mDegrees, rotationUnits::deg, false);
rBack.startRotateFor(directionType::rev, mDegrees, rotationUnits::deg, false);
}
void turnLeft(int degrees) {
suppAngle = 180 - degrees;
lFront.startRotateFor(directionType::rev, mDegrees, rotationUnits::deg, false);
lBack.startRotateFor(directionType::rev, mDegrees, rotationUnits::deg, false);
rFront.startRotateFor(directionType::fwd, mDegrees, rotationUnits::deg, false);
rBack.startRotateFor(directionType::fwd, mDegrees, rotationUnits::deg, false);
}
//Different Instances of Autonomous Periods
void blueLeft() {
}
void blueRight() {
}
void redLeft() {
}
void redRight() {
}
/*---------------------------------------------------------------------------*/
/* Pre-Autonomous Functions */
/* */
/* You may want to perform some actions before the competition starts. */
/* Do them in the following function. You must return from this function */
/* or the autonomous and usercontrol tasks will not be started. This */
/* function is only called once after the cortex has been powered on and */
/* not every time that the robot is disabled. */
/*---------------------------------------------------------------------------*/
void pre_auton( void ) {
// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions, ...
}
/*---------------------------------------------------------------------------*/
/* */
/* Autonomous Task */
/* */
/* This task is used to control your robot during the autonomous phase of */
/* a VEX Competition. */
/* */
/* You must modify the code to add your own robot specific commands here. */
/*---------------------------------------------------------------------------*/
void autonomous( void ) {
// ..........................................................................
// Insert autonomous user code here.
// ..........................................................................
}
/*---------------------------------------------------------------------------*/
/* */
/* User Control Task */
/* */
/* This task is used to control your robot during the user control phase of */
/* a VEX Competition. */
/* */
/* You must modify the code to add your own robot specific commands here. */
/*---------------------------------------------------------------------------*/
void usercontrol( void ) {
// User control code here, inside the loop
while (1) {
// This is the main execution loop for the user control program.
// Each time through the loop your program should update motor + servo
// values based on feedback from the joysticks.
// ........................................................................
// Insert user code here. This is where you use the joystick values to
// update your motors, etc.
// .......................................................................
while(true) {
arcadeDrive(75);
lift();
intake(50);
}
task::sleep(20); //Sleep the task for a short amount of time to prevent wasted resources.
}
}
//
// Main will set up the competition functions and callbacks.
//
int main() {
//Set up callbacks for autonomous and driver control periods.
Competition.autonomous( autonomous );
Competition.drivercontrol( usercontrol );
//Run the pre-autonomous function.
pre_auton();
//Prevent main from exiting with an infinite loop.
while(1) {
task::sleep(100);//Sleep the task for a short amount of time to prevent wasted resources.
}
}

There’s the code and the error. Btw do you need the robot-config too?