void usercontrol(void) {
int LASpeedPCT=50;
int RASpeedPCT=50;
int LISpeedPCT=100;
int RISpeedPCT=100;
int PuncherSpeedPCT=20;
int RRSpeedPCT=100;
int RFSpeedPCT=100;
int LRSpeeedPCT=100;
int LFSpeedPCT=100;
while (true) {
int RRSpeed = Controller1.Axis3.position();
int RFSpeed = Controller1.Axis3.position();
int LRSpeed = Controller1.Axis2.position();
int LFSpeed = Controller1.Axis2.position();
Oh, you want to drive with Joysticks? In that case, just defining an integer for the speed shouldn’t automatically generate code for the joysticks. Instead, assuming you want a tank drive, I would personally go something along the lines of
int RSpeed = Controller1.Axis3.position();
int LSpeed = Controller1.Axis2.position(); //you don’t need each individual motor to be a variable if you just reference the same variable for both wheels on one side of a drive train.
RF.spin(directionType::fwd, RSpeed, velocityUnits::pct);
RR.spin(directionType::fwd, RSpeed, velocityUnits::pct);
LF.spin(directionType::fwd, LSpeed, velocityUnits::pct);
LR.spin(directionType::fwd, LSpeed, velocityUnits::pct);
But yeah, if there is an error, which line is it on?
Do you have a screenshot of the error?
When you use int RRSpeed = Controller1.Axis3.position();
It should not be producing a variable is undefined error if you call it in the while loop. It should only be an error when you call the variable outside the while(true) loop