Thanks all for your input.
What I wanted was a quick program students can run between matches to check motor’s working.
While not sophisticated, this is what I’d envisioned and welcome any input. The one thing I haven’t figured out is when motors are directly coupled If the encoder works but motors doesn’t this may send a false positive…
/void pre_auton(void) {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
// set motor defayults
setUpMotor(L_Drive, 10);
setUpMotor(R_Drive, 10);
setUpMotor(L_Lift, 10);
setUpMotor(R_Lift, 10);
setUpMotor(Claw, 10);
} // end pre_auton
// DEFAULT MOTOR SETTINGS
void setUpMotor(motor(M),int D) {
M.value();
M.setMaxTorque(90, percentUnits::pct); // set torque
M.setTimeout(3, timeUnits::sec); // set motor timeout
M.resetRotation(); // reset encoders
M.setStopping(hold); // hold
M.spinTo(D, deg, 15, velocityUnits::pct);
dspMotor();
wait(2, seconds);
}
void dspMotor() {
Controller1.Screen.clearScreen();
Controller1.Screen.setCursor(1, 1);
Controller1.Screen.print("Drive L: %3d R: %3d",
L_Drive.current(amp)/1000,
R_Drive.current(amp)/1000); // L&R DRIVE
Controller1.Screen.setCursor(2, 1);
Controller1.Screen.print("Lift L: %3d R: %3d",
L_Lift.current(amp)/1000,
R_Lift.current(amp)/1000); // L&R LIFT
Controller1.Screen.setCursor(2, 1);
Controller1.Screen.print("Claw: %3d",
Claw.current(amp)/1000); // CLAW
} // END TEST MOTOR