Hey, I’m trying to make a user control loop and I have a slight issue. The button in the “else if” loop won’t work. It isn’t a controller issue, as I have switched the buttons and it has worked for the respective button, not it’s opposite. Any help is appreciated. Thanks in advance.
P.S. ik my code is bad cool
#pragma config(Motor, port2, leftSideDrive, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port3, rightSideDrive, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port5, leftArm, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, rightArm, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, intake, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, leftTurntable, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, rightTurntable, tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
void liftControl(int leftSide, int rightSide)
{
motor[leftTurntable] = leftSide;
motor[rightTurntable] = rightSide;
}
void armControl(int armLeft, int armRight)
{
motor[leftArm] = armLeft;
motor[rightArm] = armRight;
}
task main()
{
while (1 == 1)
{
if(vexRT[Btn6DXmtr2] == 1)
{
motor[rightArm] = 127;
}
else if(vexRT[Btn6UXmtr2] == 1)
{
motor[rightArm] = -127;
}
else
{
motor[rightArm] = 0;
}
if(vexRT[Btn6UXmtr2] == 1)
{
motor[rightArm] = -127;
}
else if(vexRT[Btn6DXmtr2] == 1)
{
motor[rightArm] = 127;
}
else
{
motor[rightArm] = 0;
}
}
}