Hello!
We are having a problem with Robot mesh studio. This is our code (in c++). Does anyone know what is wrong with it? Thanks. The output says that “Controlller1” is unidentified. Thanks!
// VEX V5 C++ Project with Competition Template
#include “vex.h”
using namespace vex;
Vex::brain Brain;
//#region config_globals
vex::brain Brain;
vex::motor motor1(vex::PORT1, vex::gearSetting::ratio18_1, false);
vex::motor motor2(vex::PORT2, vex::gearSetting::ratio18_1, false);
vex::motor motor8(vex::PORT8, vex::gearSetting::ratio18_1, false);
vex::motor motor9(vex::PORT9, vex::gearSetting::ratio18_1, false);
vex::motor motor10(vex::PORT10, vex::gearSetting::ratio18_1, false);
//#endregion config_globals
// Creates a competition object that allows access to Competition methods.
vex::competition Competition;
void pre_auton() {
// All activities that occur before competition start
// Example: setting initial positions
}
void autonomous() {
// Place autonomous code here
}
void drivercontrol() {
// Place drive control code here, inside the loop
#include “robot-config.h”
while (true) {
motor1.spin(vex::directionType::fwd, Controller1.Axis2.value(), vex::velocityUnits::pct);
motor9.spin(vex::directionType::fwd, Controller1.Axis2.value(), vex::velocityUnits::pct);
motor10.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct);
motor2.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct);
}
}
int main() {
// Do not adjust the lines below
// Set up (but don't start) callbacks for autonomous and driver control periods.
Competition.autonomous(autonomous);
Competition.drivercontrol(drivercontrol);
// Run the pre-autonomous function.
pre_auton();
// Robot Mesh Studio runtime continues to run until all threads and
// competition callbacks are finished.
}