Unofficial Reply: Linear Punch Pid Control Help

General rule of thumb: Posting in the official support threads is generally for questions regarding specific details about RobotC, not necessarily general programming help.

I would suggest against using the Natural Language and just learn to use the straight RobotC launguage, I find it’s much more intuitive as well, and you don’t have to learn all the little Natural Language specific commands.

  1. “setmultiplemotors” is not a command. You just need to write each command in a separate line, or you could make it into a function to call them all at once, like so:
void SetMultipleMotors(int motor1, int power1, int motor2, int power2, int motor3, int power3)
	motor[motor1] = power1;
	motor[motor2] = power2;
	motor[motor3] = power3;
task main()
	SetMultipleMotors(drivemotor, 127, clawmotor, 30, liftmotor, 60);
  1. You can prevent your motors from just running at the start by either waiting, or tying them to an if/else statement:
if(SensorValue[limitswitch] == 1)
motor[a] = 127;
motor[a] = 0;

  1. You can reset quad encoders with the following command:
SensorValue[encoder] = 0;

I’m not using quadrature encoders I meant to reset the IEMs.

Specific to the IEMs in my code, I don’t know how to reset the encoder count when I want to shoot, then have it run the motors to stop it. I also need to set this up to my flywheel as well but once again I’m not sure how to do such.

It is a natural language function. In the future I would recommend right clicking functions and selecting “Go To definition/declaration”.

Defined as

void setMultipleMotors(const short speed = 50, const tMotor firstMotor = port1, const tMotor secondMotor = noMotorOnPort, const tMotor thirdMotor = noMotorOnPort, const tMotor fourthMotor = noMotorOnPort)
	if(firstMotor != noMotorOnPort) 	setMotorSpeed(firstMotor, speed);
	if(secondMotor != noMotorOnPort) 	setMotorSpeed(secondMotor, speed);
	if(thirdMotor != noMotorOnPort) 	setMotorSpeed(thirdMotor, speed);
	if(fourthMotor != noMotorOnPort) 	setMotorSpeed(fourthMotor, speed);

The default values allow you to enter 1-4 motors without running into issues.