VEX Code V5: make process closed with exit code : 2

woah, that’s pretty cool. thanks!

Yep, for sure. Oh, by the way, here’s the full error. This is probably a lost cause, but before I move to some other coding software maybe this can be salvaged.
image

hmm… I really don’t know whats wrong. have you tried restarting vexcode/your computer?

Yep, I have. It still throws the same error.

well, I’m really sorry I couldn’t help.
if this is of any significance, I have my statements in this order

#include "vex.h"

using namespace vex;

#include "ConfigureRobot.h"

EDIT: I may be on to something. you have your configurey stuff before you include vex.h. that may be an issue.

3 Likes

OK, I just figured out what the problem was, hopefully this will help anyone having problems with this in the future.

Make sure you have int (main) in at least one of your src functions, otherwise it won’t build

1 Like

I am having this issue as well. My code is throwing the same “make process closed with exit code : 2” error.

My code is below.

/*----------------------------------------------------------------------------*/
/*                                                                            */
/*    Module:       main.cpp                                                  */
/*    Author:       8116 Robotics Programmers                                 */
/*    Created:      Wed Apr 03 2019                                           */
/*    Description:  2019-2020 Tower Takeover Robot Program                    */
/*                                                                            */
/*----------------------------------------------------------------------------*/

#include "vex.h"

using namespace vex;

vex::competition Competition;
// A global instance of vex::brain used for printing to the V5 brain screen
vex::brain       Brain;
vex::controller Controller1;
vex::motor LeftDrive (vex::PORT11);
vex::motor RightDrive (vex::PORT20, true);
vex::motor StackLeft (vex::PORT12);
vex::motor StackRight (vex::PORT13);
vex::motor StackTilt (vex::PORT14);
vex::motor LArm (vex::PORT15, true);
vex::motor RArm (vex::PORT16);
vex::motor ArmClaw (vex::PORT17);
vex::gyro Gyro(Brain.ThreeWirePort.H);
//8 Motors Used
//2 Motor Drive
//2 Motor Stacker Intake
//1 Motor Stacker Tilt
//2 Motor Tower Arm
//1 Motor Claw

//Slow Mode Variables
double slow0 = 1.000;
double slow1 = 0.700;
double slow2 = 0.300;
double slow3 = 0.050;
double slowmulti;
int slowrange = 0;
// Mechanism Power Variables
int armpower = 70;
int clawpower = 70;
int stacktiltpower = 5;
int intakepower = 60;
int dischargepower = 40;

//Mechanism Distance Variables
int armdeg;
int movecubedeg;
int tiltstackdeg = 135;

//Gyro Variables
double gyrobias = 0;
double gyrotarget, gyrolower, gyroupper;
double gyrodeadband = 0.5;

//Autonomous Selector Variables
bool showautoselect = true;


/*
        James Pearman autoselect functions and definitions. These are modified
   for Walsh
*/
// collect data for on screen button and include off and on color feedback for
// button prc - instead of radio approach with one button on or off at a time,
// each button has
// a state.  ie shootPreload may be low yellow and high yellow when on.
typedef struct _button {
  int xpos;
  int ypos;
  int width;
  int height;
  bool state;
  vex::color offColor;
  vex::color onColor;
  const char *label;
} button;

// Button array definitions for each software button. The purpose of each button
// data structure is defined above.  The array size can be extended, so you can
// have as many buttons as you wish as long as it fits.
button buttons[] = {
  {30, 30, 60, 60, false, 0xE00000, 0x0000E0, "Ally"},
  {150, 30, 60, 60, false, 0x303030, 0xD0D0D0, "Start"},
  {270, 30, 60, 60, false, 0x303030, 0xF700FF, "Alt"},
  {390, 30, 60, 60, false, 0x303030, 0x00DD00, "Skill"},
  {30, 150, 60, 60, false, 0x404040, 0xC0C0C0, "1-"},
  {150, 150, 60, 60, false, 0x404040, 0xC0C0C0, "2-"},
  {270, 150, 60, 60, false, 0x404040, 0xC0C0C0, "3-"},
  {390, 150, 60, 60, false, 0x00DD00, 0xE00000, "Run Auto"}
  };

// forward ref
void displayButtonControls(int index, bool pressed);

/*-----------------------------------------------------------------------------*/
/** @brief      Check if touch is inside button */
/*-----------------------------------------------------------------------------*/
int findButton(int16_t xpos, int16_t ypos) {
  int nButtons = sizeof(buttons) / sizeof(button);

  for (int index = 0; index < nButtons; index++) {
    button *pButton = &buttons[index];
    if (xpos < pButton->xpos || xpos > (pButton->xpos + pButton->width))
      continue;

    if (ypos < pButton->ypos || ypos > (pButton->ypos + pButton->height))
      continue;

    return (index);
  }
  return (-1);
}

/*-----------------------------------------------------------------------------*/
/** @brief      Init button states */
/*-----------------------------------------------------------------------------*/
void initButtons() {
  int nButtons = sizeof(buttons) / sizeof(button);

  for (int index = 0; index < nButtons; index++) {
    buttons[index].state = false;
  }
}

/*-----------------------------------------------------------------------------*/
/** @brief      Screen has been touched */
/*-----------------------------------------------------------------------------*/
void userTouchCallbackPressed() {
  int index;
  int xpos = Brain.Screen.xPosition();
  int ypos = Brain.Screen.yPosition();

  if ((index = findButton(xpos, ypos)) >= 0) {
    displayButtonControls(index, true);
  }
}

/*-----------------------------------------------------------------------------*/
/** @brief      Screen has been (un)touched */
/*-----------------------------------------------------------------------------*/
void userTouchCallbackReleased() {
  int index;
  int xpos = Brain.Screen.xPosition();
  int ypos = Brain.Screen.yPosition();

  if ((index = findButton(xpos, ypos)) >= 0) {
    // clear all buttons to false, ie. unselected
    //      initButtons();

    // now set this one as true
    if (buttons[index].state == true) {
      buttons[index].state = false;
    } else {
      buttons[index].state = true;
    }
    displayButtonControls(index, false);
  }
}

/*-----------------------------------------------------------------------------*/
/** @brief      Draw all buttons */
/*-----------------------------------------------------------------------------*/
void displayButtonControls(int index, bool pressed) {
  vex::color c;
  Brain.Screen.setPenColor(vex::color(0xe0e0e0));

  for (int i = 0; i < sizeof(buttons) / sizeof(button); i++) {

    if (buttons[i].state)
      c = buttons[i].onColor;
    else
      c = buttons[i].offColor;

    Brain.Screen.setFillColor(c);

    // button fill
    if (i == index && pressed == true) {
      Brain.Screen.drawRectangle(buttons[i].xpos, buttons[i].ypos,
                                 buttons[i].width, buttons[i].height, c);
    } else
      Brain.Screen.drawRectangle(buttons[i].xpos, buttons[i].ypos,
                                 buttons[i].width, buttons[i].height);

    // outline
    Brain.Screen.drawRectangle(buttons[i].xpos, buttons[i].ypos,
                               buttons[i].width, buttons[i].height,
                               vex::color::transparent);

    // draw label
    if (buttons[i].label != NULL)
      Brain.Screen.printAt(buttons[i].xpos + 8,
                           buttons[i].ypos + buttons[i].height - 8,
                           buttons[i].label);
  }
}



void encdrive (double powerpct, double degrees)
{
 
  LeftDrive.spinFor(degrees, rotationUnits::deg, powerpct, velocityUnits::pct,false);
  RightDrive.spinFor(degrees, rotationUnits::deg, powerpct, velocityUnits::pct, true);
}

void turn (double powerpct, int amount, bool end)
{
  bool complete=false;
  if(powerpct>=0)
  {
    gyrotarget=Gyro.value(rotationUnits::deg)-abs(amount);
  }
  else{
    gyrotarget=Gyro.value(rotationUnits::deg)+abs(amount);
  }
  
  gyrolower=gyrotarget-gyrodeadband;
  gyroupper=gyrotarget+gyrodeadband;

  
  if(gyroupper>360)
  {
    gyroupper=gyroupper-360;
  }
  if(gyrolower>360)
  {
    gyrolower=gyrolower-360;
  }
  if(gyroupper<-360)
  {
    gyroupper=gyroupper+360;
  }
  if(gyrolower<-360)
  {
    gyrolower=gyrolower+360;
  }
  

  while(complete==false)
  {
    LeftDrive.spin(vex::directionType::fwd, (powerpct), velocityUnits::pct);
    RightDrive.spin(vex::directionType::fwd, (powerpct), velocityUnits::pct);
    if(Gyro.value(rotationUnits::deg)>gyrolower && Gyro.value(rotationUnits::deg)<gyroupper)
    {
      complete=true;
    }
  }
  if(end==true)
  {
    LeftDrive.stop(brakeType::coast);
    RightDrive.stop(brakeType::coast);
  }
}

void encstacktilt (bool forward)
{
  if(forward==true)
  {
    StackTilt.spinFor(135, rotationUnits::deg, 10, velocityUnits::rpm);
  }
  else
  {
    StackTilt.spinFor(-135, rotationUnits::deg, 10, velocityUnits::rpm);
  }
}
int encstacktiltfwd ()
{
  
    StackTilt.spinFor(135, rotationUnits::deg, 10, velocityUnits::rpm);
    return 0;
}
void encstacktiltrev ()
{
  
    StackTilt.spinFor(-135, rotationUnits::deg, 10, velocityUnits::rpm);
}

void towerarmenc (double powerpct, double degrees)
{
  LArm.spinFor(degrees, rotationUnits::deg, powerpct, velocityUnits::pct);
  RArm.spinFor(degrees, rotationUnits::deg, powerpct, velocityUnits::pct);
}

void cubeintakerun (bool run)
{
  if(run)
  {
    StackLeft.spin(directionType::fwd, intakepower, velocityUnits::pct);
    StackRight.spin(directionType::fwd, intakepower, velocityUnits::pct);
  }
  else
  {
    StackLeft.stop(brakeType::hold);
    StackRight.stop(brakeType::hold);
  }
}

/*---------------------------------------------------------------------------*/
/*                          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) {
  /* initialize capabilities from buttons */
  showautoselect=false;
  bool allianceBlue = buttons[0].state;
  bool altStartPos = buttons[1].state;
  bool alt = buttons[2].state;
  bool skills = buttons[3].state;
  bool mode1 = buttons[4].state;
  bool mode2 = buttons[5].state;
  bool mode3 = buttons[6].state;
  bool autooff = buttons[7].state;

  //Autonomous Programs (Labeled by header Comments)

  if(autooff==false){
    if(altStartPos == false)
    {
      //Alliance Tower Side Autonomous (Both Alliances)

      //Drive forward from the starting position to the beginning of the cubes.
      encdrive(45, 720);
      //Tip the cube tray forward.
      encstacktilt(true);
      //Turn on the Cube Intake and drive forward to intake the cubes.
      cubeintakerun(true);
      encdrive(25, 540);
      //Turn off the cube intake and tilt the cube tray back.
      cubeintakerun(false);
      encstacktilt(false);
      //Turn around 180 degrees to face alliance station
      turn(30, 180, true);
      //Drive Forward towards the wall
      encdrive(45, 1080);
      //Turn to face the small goal
      if(allianceBlue==false)
      {
        //If Red, turn Left
        turn(-30, 90, true);
      }
      if(allianceBlue==true)
      {
        //If Blue, turn Right
        turn(30, 90, true);
      }
      //Drive to the small goal
      encdrive(40, 360);
      //Tip the cube tray forward
      encstacktilt(true);
      //Drive Backwards to release the stack.
      encdrive(-30, 360);
    }

  }
  // ..........................................................................
  // 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
  //Print Static slow mode Instructions to the controller screen before the loop starts
  Controller1.Screen.setCursor(1,1);
  Controller1.Screen.newLine();
  Controller1.Screen.print("Use The Arrow");
  Controller1.Screen.newLine();
  Controller1.Screen.print("Buttons to Toggle");

  while (1) {
    if(Controller1.ButtonDown.pressing()){
     if(slowrange<3){
      slowrange=slowrange+1;
     }
   }
   else if (Controller1.ButtonUp.pressing()) {
   if(slowrange>0){
      slowrange=slowrange-1;
     }
   }
   Controller1.Screen.clearLine(1);
   switch(slowrange){
      case 0:slowmulti=slow0;
             Controller1.Screen.print("Slow Mode:  100 pct");
      break;
      case 1:slowmulti=slow1;
             Controller1.Screen.print("Slow Mode:  70 pct");
      break;
      case 2:slowmulti=slow2;
             Controller1.Screen.print("Slow Mode:  30 pct");
      break;
      case 3:slowmulti=slow3;
             Controller1.Screen.print("Slow Mode:  5 pct");
      break;
   }
    //Drive Motors
    LeftDrive.spin(vex::directionType::fwd, (slowmulti*Controller1.Axis3.position()), vex::velocityUnits::pct);
    RightDrive.spin(vex::directionType::fwd, (slowmulti*Controller1.Axis2.position()), vex::velocityUnits::pct);
    //Stack Tilt
    if(Controller1.ButtonL1.pressing())
      {
        encstacktilt(true);
        task::sleep(10);
      }
    else if (Controller1.ButtonL2.pressing()) 
      {
        encstacktilt(false);
        task::sleep(10);
      }
    else 
      {
    StackTilt.setBrake(brakeType::hold);
    }
    
    

    //Arm Control
    if(Controller1.ButtonR1.pressing()) { 
        //...Spin the arm motor forward.
        LArm.spin(vex::directionType::fwd, 70, vex::velocityUnits::pct);
        RArm.spin(vex::directionType::fwd, 70, vex::velocityUnits::pct);
      }
      // else If the down button is pressed...
      else 
      if(Controller1.ButtonR2.pressing()) { 
        //...Spin the arm motor backward.
        LArm.spin(vex::directionType::rev, 70, vex::velocityUnits::pct);
        RArm.spin(vex::directionType::rev, 70, vex::velocityUnits::pct);
      }
      // else If neither up or down button is pressed...
      else { 
        //...Stop the arm motor.
        LArm.stop(vex::brakeType::brake);
        RArm.stop(vex::brakeType::brake);
      }
   
    vex::task::sleep(10); // 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();

  // register events for button selection
  Brain.Screen.pressed(userTouchCallbackPressed);
  Brain.Screen.released(userTouchCallbackReleased);

  // make nice background
  Brain.Screen.setFillColor(vex::color(0x909000));
  Brain.Screen.setPenColor(vex::color(0x909000));
  Brain.Screen.drawRectangle(0, 0, 480, 120);
  Brain.Screen.setFillColor(vex::color(0x000060));
  Brain.Screen.setPenColor(vex::color(0x000060));
  Brain.Screen.drawRectangle(0, 120, 480, 120);

  // initial display
  displayButtonControls(0, false);

  while (showautoselect) {
    // Allow other tasks to run
    if (!Competition.isEnabled())
      Brain.Screen.setFont(fontType::mono40);
    Brain.Screen.setFillColor(vex::color(0xFFFFFF));

    Brain.Screen.setPenColor(vex::color(0x800000));
    Brain.Screen.printAt(0, 135, "  ILHS 8116 Competition  ");
    this_thread::sleep_for(10);
  }

  // Prevent main from exiting with an infinite loop.
  while (1) {
    vex::task::sleep(100); // Sleep the task for a short amount of time to
                           // prevent wasted resources.
  }
}

That code builds ok here (except for a few warnings). Can you clear, build and then post the output of the “Output” window here, for example, this is what I see when I build.

[info]: Saving Project ...
[info]: Project saved!
unix build for platform vexv5
CXX src/main.cpp
src/main.cpp:333:8: warning: unused variable 'mode1' [-Wunused-variable]
  bool mode1 = buttons[4].state;
       ^
src/main.cpp:331:8: warning: unused variable 'alt' [-Wunused-variable]
  bool alt = buttons[2].state;
       ^
src/main.cpp:335:8: warning: unused variable 'mode3' [-Wunused-variable]
  bool mode3 = buttons[6].state;
       ^
src/main.cpp:332:8: warning: unused variable 'skills' [-Wunused-variable]
  bool skills = buttons[3].state;
       ^
src/main.cpp:334:8: warning: unused variable 'mode2' [-Wunused-variable]
  bool mode2 = buttons[5].state;
       ^
5 warnings generated.
LINK build/MyProjectMakeError.elf
   text	   data	    bss	    dec	    hex	filename
  15180	   1148	1064976	1081304	 107fd8	build/MyProjectMakeError.elf
[info]: build completed!
[info]: download
[info]: download completed!
5 Likes

This is the output of the build

    [info]: Project Path: E:\Robot Programs\2019-2020\VEXcode\TT Robot\8116ATTRobot Main
    [info]: Saving Project ...
    [info]: Project saved!
    windows build for platform vexv5
    vex/mkrules.mk:23: warning: overriding recipe for target 'build/8116ATTRobot'
    vex/mkrules.mk:17: warning: ignoring old recipe for target 'build/8116ATTRobot'
    make: Circular build/8116ATTRobot <- build/8116ATTRobot dependency dropped.
    Usage: arm-none-eabi-objcopy [option(s)] in-file [out-file]
     Copies a binary file, possibly transforming it in the process
     The options are:
      -I --input-target <bfdname>      Assume input file is in format <bfdname>
      -O --output-target <bfdname>     Create an output file in format <bfdname>
      -B --binary-architecture <arch>  Set output arch, when input is arch-less
      -F --target <bfdname>            Set both input and output format to <bfdname>
         --debugging                   Convert debugging information, if possible
      -p --preserve-dates              Copy modified/access timestamps to the output
      -D --enable-deterministic-archives
                                       Produce deterministic output when stripping archives
      -U --disable-deterministic-archives
                                       Disable -D behavior (default)
      -j --only-section <name>         Only copy section <name> into the output
         --add-gnu-debuglink=<file>    Add section .gnu_debuglink linking to <file>
      -R --remove-section <name>       Remove section <name> from the output
      -S --strip-all                   Remove all symbol and relocation information
      -g --strip-debug                 Remove all debugging symbols & sections
         --strip-dwo                   Remove all DWO sections
         --strip-unneeded              Remove all symbols not needed by relocations
      -N --strip-symbol <name>         Do not copy symbol <name>
         --strip-unneeded-symbol <name>
                                       Do not copy symbol <name> unless needed by
                                         relocations
         --only-keep-debug             Strip everything but the debug information
         --extract-dwo                 Copy only DWO sections
         --extract-symbol              Remove section contents but keep symbols
      -K --keep-symbol <name>          Do not strip symbol <name>
         --keep-file-symbols           Do not strip file symbol(s)
         --localize-hidden             Turn all ELF hidden symbols into locals
      -L --localize-symbol <name>      Force symbol <name> to be marked as a local
         --globalize-symbol <name>     Force symbol <name> to be marked as a global
      -G --keep-global-symbol <name>   Localize all symbols except <name>
      -W --weaken-symbol <name>        Force symbol <name> to be marked as a weak
         --weaken                      Force all global symbols to be marked as weak
      -w --wildcard                    Permit wildcard in symbol comparison
      -x --discard-all                 Remove all non-global symbols
      -X --discard-locals              Remove any compiler-generated symbols
      -i --interleave [<number>]       Only copy N out of every <number> bytes
         --interleave-width <number>   Set N for --interleave
      -b --byte <num>                  Select byte <num> in every interleaved block
         --gap-fill <val>              Fill gaps between sections with <val>
         --pad-to <addr>               Pad the last section up to address <addr>
         --set-start <addr>            Set the start address to <addr>
        {--change-start|--adjust-start} <incr>
                                       Add <incr> to the start address
        {--change-addresses|--adjust-vma} <incr>
                                       Add <incr> to LMA, VMA and start addresses
        {--change-section-address|--adjust-section-vma} <name>{=|+|-}<val>
                                       Change LMA and VMA of section <name> by <val>
         --change-section-lma <name>{=|+|-}<val>
                                       Change the LMA of section <name> by <val>
         --change-section-vma <name>{=|+|-}<val>
                                       Change the VMA of section <name> by <val>
        {--[no-]change-warnings|--[no-]adjust-warnings}
                                       Warn if a named section does not exist
         --set-section-flags <name>=<flags>
                                       Set section <name>'s properties to <flags>
         --add-section <name>=<file>   Add section <name> found in <file> to output
         --rename-section <old>=<new>[,<flags>] Rename section <old> to <new>
         --long-section-names {enable|disable|keep}
                                       Handle long section names in Coff objects.
         --change-leading-char         Force output format's leading character style
         --remove-leading-char         Remove leading character from global symbols
         --reverse-bytes=<num>         Reverse <num> bytes at a time, in output sections with content
         --redefine-sym <old>=<new>    Redefine symbol name <old> to <new>
         --redefine-syms <file>        --redefine-sym for all symbol pairs 
                                         listed in <file>
         --srec-len <number>           Restrict the length of generated Srecords
         --srec-forceS3                Restrict the type of generated Srecords to S3
         --strip-symbols <file>        -N for all symbols listed in <file>
         --strip-unneeded-symbols <file>
                                       --strip-unneeded-symbol for all symbols listed
                                         in <file>
         --keep-symbols <file>         -K for all symbols listed in <file>
         --localize-symbols <file>     -L for all symbols listed in <file>
         --globalize-symbols <file>    --globalize-symbol for all in <file>
         --keep-global-symbols <file>  -G for all symbols listed in <file>
         --weaken-symbols <file>       -W for all symbols listed in <file>
         --alt-machine-code <index>    Use the target's <index>'th alternative machine
         --writable-text               Mark the output text as writable
         --readonly-text               Make the output text write protected
         --pure                        Mark the output file as demand paged
         --impure                      Mark the output file as impure
         --prefix-symbols <prefix>     Add <prefix> to start of every symbol name
         --prefix-sections <prefix>    Add <prefix> to start of every section name
         --prefix-alloc-sections <prefix>
                                       Add <prefix> to start of every allocatable
                                         section name
         --file-alignment <num>        Set PE file alignment to <num>
         --heap <reserve>[,<commit>]   Set PE reserve/commit heap to <reserve>/
                                       <commit>
         --image-base <address>        Set PE image base to <address>
         --section-alignment <num>     Set PE section alignment to <num>
         --stack <reserve>[,<commit>]  Set PE reserve/commit stack to <reserve>/
                                       <commit>
         --subsystem <name>[:<version>]
                                       Set PE subsystem to <name> [& <version>]
         --compress-debug-sections     Compress DWARF debug sections using zlib
         --decompress-debug-sections   Decompress DWARF debug sections using zlib
      -v --verbose                     List all object files modified
      @<file>                          Read options from <file>
      -V --version                     Display this program's version number
      -h --help                        Display this output
         --info                        List object formats & architectures supported
    arm-none-eabi-objcopy: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
    make: *** [vex/mkrules.mk:23: build/8116ATTRobot]

Have you modified the build files ?
perhaps zip the whole project and send it to me.

1 Like

To my knowledge, I have not modified the build files, but I am still learning and learn by trying so I don’t know.
My Zipped project folder is below.
8116ATTRobot Main Zipped.zip (90.7 KB)

ok, the issue was whitespace (ie. a space) in the project solution name, we don’t usually allow you to create projects like that. Anyway, here’s a revised project that builds.
8116ATTRobotMain.zip (110.6 KB)

7 Likes

Thanks for your help.

1 Like

@jpearman i need some help trying to understand what i need to do to fix this problem i keep having that error

How did you fix the problem

either post the code or at least copy the contents of the output tab and attach to this topic.

1 Like

@jpearman our teams quite confused as well so ill post the output tab, any help is greatly appreciated

windows build for platform vexv5
“LINK build/Robot.elf”
build/src/robot-config.o:(.bss.Brain+0x0): multiple definition of `Brain’
build/src/main.o:(.bss.Brain+0x0): first defined here
make: *** [vex/mkrules.mk:18: build/Robot.elf] Error 1
[error]: make process closed with exit code : 2

You have two instances of a global called Brain. Comment one out.

4 Likes
/*----------------------------------------------------------------------------*/
/*                                                                            */
/*    Module:       main.cpp                                                  */
/*    Author:       C:\Users\Anthonie                                         */
/*    Created:      Thu Oct 10 2019                                           */
/*    Description:  V5 project                                                */
/*                                                                            */
/*----------------------------------------------------------------------------*/

// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name]               [Type]        [Port(s)]
// ---- END VEXCODE CONFIGURED DEVICES ----

#include "vex.h"
using namespace vex;

vex::motor      motor_right(vex::PORT1);
vex::motor      motor_left(vex::PORT2);
vex::motor Elbow (vex::PORT3);
vex::motor Elbow2 (vex::PORT4);
vex::motor Hand1 (vex::PORT17);
vex::motor Hand2 (vex::PORT13);
vex::motor tail (vex::PORT10);
vex::controller con(vex::controllerType::primary);
int main() {

  vexcodeInit();
   //Left motor, vertical axis of left joystick plus horizontal axis of left joystick
       motor_left.spin(vex::directionType::fwd,con
.Axis3.position(vex::percentUnits::pct) +con
.Axis4.position(vex::percentUnits::pct),
           vex::velocityUnits::pct);
       //Right motor, vertical axis of left joystick minus horizontal axis of left joystick
       motor_right.spin(vex::directionType::fwd,con
.Axis3.position(vex::percentUnits::pct) -con
.Axis4.position(vex::percentUnits::pct),
           vex::velocityUnits::pct);
              
   


   // This is the main execution loop for the user control program.
      
           //Elbow Motor
               if (con
.ButtonL1.pressing())
               { 

                   Elbow.spin(vex::directionType::fwd,100,vex::velocityUnits::rpm);
                   Elbow2.spin(vex::directionType::rev,100,vex::velocityUnits::rpm);
               } 
               else if (con
.ButtonL2.pressing())
               {

                   Elbow.spin(vex::directionType::rev,100,vex::velocityUnits::rpm);
                   Elbow2.spin(vex::directionType::rev,100,vex::velocityUnits::rpm);
               }
               else 
               {   
                   Elbow.stop(vex::brakeType::hold);
                    Elbow2.stop(vex::brakeType::hold);
               }
           //Hand Motors
               if (con
.ButtonR1.pressing())
               {   

                   Hand1.spin(vex::directionType::fwd,100,vex::velocityUnits::rpm);
                   Hand2.spin(vex::directionType::rev,100,vex::velocityUnits::rpm);
               } 
               else if (con
.ButtonR2.pressing())
               {

                   Hand1.spin(vex::directionType::rev,100,vex::velocityUnits::rpm);
                   Hand2.spin(vex::directionType::fwd,100,vex::velocityUnits::rpm);
               }
               else 
               {
                   Hand1.stop(vex::brakeType::hold);
                   Hand2.stop(vex::brakeType::hold);
               }
   
   
   if( con
.ButtonA.pressing() ) {
motor_right.stop(vex::brakeType::hold );

motor_left.stop(vex::brakeType::hold );
      
   }
   else if( con
.ButtonY.pressing()) {
motor_right.stop(vex::brakeType::coast );

motor_left.stop(vex::brakeType::coast );
      
   }
   if (con
.ButtonB.pressing())
               {   

                   tail.spin(vex::directionType::fwd,100,vex::velocityUnits::rpm);
               } 
               else if (con
.ButtonX.pressing())
               {
                   tail.spin(vex::directionType::rev,100,vex::velocityUnits::rpm);
               }
       else
               {
                   tail.stop(vex::brakeType::hold);
 
               }} 

@jpearman

i fixed the error but now the robot dosn’t move at all