I’m trying to combine 3 motors on both the left and the right side to make a drivetrain, but I can’t seem to get it to work. I have put my code below if anyone has any ideas what I am doing wrong.
// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name] [Type] [Port(s)]
// Controller1 controller
// lf motor 1
// lm motor 2
// lb motor 3
// rf motor 4
// rm motor 5
// rb motor 6
// ---- END VEXCODE CONFIGURED DEVICES ----
#include “vex.h”
using namespace vex;
// A global instance of competition
competition Competition;
// define your global instances of motors and other devices here
distanceUnits unit = distanceUnits::in;
double wheelTravel = 4 * 3.14;
double trackWidth = 18;
double wheelBase = 15;
double externalGearRatio = 1;
vex::motor_group l = motor_group(lf, lm, lb);
vex::motor_group r = motor_group(rf, rm, rb);
vex::drivetrain sixDrive(motor_group &l, motor_group &r, double wheelTravel, double trackWidth, double wheelBase, distanceUnits unit = distanceUnits::in, double externalGearRatio = 1.0);
void pre_auton(void) {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions, …
}
void autonomous(void) {
// …
// Insert autonomous user code here.
// …
sixDrive.driveFor(forward, 10, inches);
}