I am currently having an issue with addition and subtraction, In my Ch3/Ch4 addition it had worked fine, but with Ch3/Ch4 when addition or subtraction is used, the entire string fails to compile.
Blockquote#pragma config(Motor, port2, leftMotor, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port3, lift, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, servo, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, motor1, tmotorVex393_MC29, openLoop, encoderPort, None)
#pragma config(Motor, port9, rightMotor, tmotorVex393_MC29, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
//revision 27.1022
//Attempting control via ch3/ch4 joystick.
task main()
{
//int i = 60;
//int k = -60;
while(1 == 1)
{
motor[leftMotor] = (vexRT[Ch2] + vexRT[Ch1])/2; // (y + x)/2
motor[rightMotor] = (vexRT[Ch2] - vexRT[Ch1])/2; // (y - x)/2
motor[lift] = (vexRT[Ch4] + [Ch3])/2; //issue)
motor[servo] = (vexRT[Ch4] - [Ch3])/2; //issue)
if (vexRT[Btn6D] == 1)
{
motor[leftMotor] = 60;
motor[rightMotor] = 60;
}
else if(vexRT[Btn5D] == 1)
{
motor[leftMotor] = -60;
motor[rightMotor] = -60;
}
else if(vexRT[Btn5U] == 1)
{
motor[leftMotor] = 100;
motor[rightMotor] = -100;
}
else if(vexRT[Btn8L] == 1)
{
motor[servo] = -85
;
}
else if(vexRT[Btn8R] == 1)
{
motor[servo] = 85;
}
else if(vexRT[Btn6U] == 1)
{
motor[leftMotor] = -100;
motor[rightMotor] = 100;
}
else if(vexRT[Btn7R] == 1)
{
motor[lift] = 60;
}
else if(vexRT[Btn7L] == 1)
{
motor[lift] = -60;
}
else if(vexRT[Btn6U] == 0)
{
motor[leftMotor] = 0;
motor[rightMotor] = 0;
motor[lift] = 0;
motor[servo] = 0;
}
}
}
Blockquote