how would
I fix this issue
it says that there are 14 errors? what do I need to change them to or how do I need to fix it.
#pragma region VEXcode Generated Robot Configuration
// Make sure all required headers are included.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include <string.h>
#include "vex.h"
using namespace vex;
// Brain should be defined by default
brain Brain;
// START V5 MACROS
#define waitUntil(condition) \
do { \
wait(5, msec); \
} while (!(condition))
#define repeat(iterations) \
for (int iterator = 0; iterator < iterations; iterator++)
// END V5 MACROS
// Robot configuration code.
motor LeftDriveSmart = motor(PORT1, ratio18_1, false);
motor RightDriveSmart = motor(PORT10, ratio18_1, true);
drivetrain Drivetrain = drivetrain(LeftDriveSmart, RightDriveSmart, 319.19, 295, 40, mm, 1);
controller Controller1 = controller(primary);
motor MotorGroup3MotorA = motor(PORT3, ratio18_1, true);
motor MotorGroup3MotorB = motor(PORT8, ratio18_1, true);
motor_group MotorGroup3 = motor_group(MotorGroup3MotorA, MotorGroup3MotorB);
// Helper to make playing sounds from the V5 in VEXcode easier and
// keeps the code cleaner by making it clear what is happening.
void playVexcodeSound(const char *soundName) {
printf("VEXPlaySound:%s\n", soundName);
wait(5, msec);
}
// define variable for remote controller enable/disable
bool RemoteControlCodeEnabled = true;
// define variables used for controlling motors based on controller inputs
bool DrivetrainNeedsToBeStopped_Controller1 = true;
// define a task that will handle monitoring inputs from Controller1
int rc_auto_loop_function_Controller1() {
// process the controller input every 20 milliseconds
// update the motors based on the input values
while(true) {
if(RemoteControlCodeEnabled) {
// calculate the drivetrain motor velocities from the controller joystick axies
// left = Axis3 + Axis4
// right = Axis3 - Axis4
int drivetrainLeftSideSpeed = Controller1.Axis3.position() + Controller1.Axis4.position();
int drivetrainRightSideSpeed = Controller1.Axis3.position() - Controller1.Axis4.position();
// check if the values are inside of the deadband range
if (abs(drivetrainLeftSideSpeed) < 5 && abs(drivetrainRightSideSpeed) < 5) {
// check if the motors have already been stopped
if (DrivetrainNeedsToBeStopped_Controller1) {
// stop the drive motors
LeftDriveSmart.stop();
RightDriveSmart.stop();
// tell the code that the motors have been stopped
DrivetrainNeedsToBeStopped_Controller1 = false;
}
} else {
// reset the toggle so that the deadband code knows to stop the motors next time the input is in the deadband range
DrivetrainNeedsToBeStopped_Controller1 = true;
}
// only tell the left drive motor to spin if the values are not in the deadband range
if (DrivetrainNeedsToBeStopped_Controller1) {
LeftDriveSmart.setVelocity(drivetrainLeftSideSpeed, percent);
LeftDriveSmart.spin(forward);
}
// only tell the right drive motor to spin if the values are not in the deadband range
if (DrivetrainNeedsToBeStopped_Controller1) {
RightDriveSmart.setVelocity(drivetrainRightSideSpeed, percent);
RightDriveSmart.spin(forward);
}
}
// wait before repeating the process
wait(20, msec);
}
return 0;
}
task rc_auto_loop_task_Controller1(rc_auto_loop_function_Controller1);
#pragma endregion VEXcode Generated Robot Configuration
#include "vex.h"
using namespace vex;
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
// Define motors
motor motorgroup3 = motor(PORT3, ratio18_1, true);
motorgroup3.spin(FORWARD, slowspeed, velocityUnits::pct)
motorgroup3.stop()
// Define drivetrain
drivetrain drive = drivetrain(PORT1, PORT2, 319.19, 295, 170, mm, 1);
// Define controller
controller Controller1 = controller();
// Set the motor velocity (adjust as needed)
int maxSpeed = 50; // Maximum speed for the drivetrain
int slowSpeed = 10; // Speed for motorgroup3
while (true) {
// Get joystick values
int verticalLeft = Controller1.Axis3.position(); // Get vertical position of the left joystick
int verticalRight = Controller1.Axis2.position(); // Get vertical position of the right joystick
// Calculate the adjusted speed based on joystick position for the drivetrain
int adjustedSpeed = (maxSpeed * verticalLeft) / 127;
// Drive the drivetrain with adjusted speed
drive.driveFor(adjustedSpeed, percent);
// Control motorsgroup3 with the right joystick for up and down movement
if (verticalRight > 10) {
motor3.spin(forward, slowSpeed, velocityUnits::pct);
motor8.spin(forward, slowSpeed, velocityUnits::pct);
} else if (verticalRight < -10) {
motor3.spin(reverse, slowSpeed, velocityUnits::pct);
motor8.spin(reverse, slowSpeed, velocityUnits::pct);
} else {
motor3.stop();
motor8.stop();
}
wait(20, msec); // Allow other tasks to run
}
}
What can i do to fix things errors - #5 by cashtheflash62 You need to learn how to use semicolons.
Basically, you were telling the compiler that you were done with the main program with the semicolon, so it didn’t know what to do with a random bracket.