Hello, I have been making a ridiculously overcomplicated program for having a failsafe, as my motors failed way too many times during nothing but net. I have some integers being changed withing if loops. I should note that the ints that arent working have gray x’s in front. Here is my code:
task usercontrol()
{
// User control code here, inside the loop
//int x declaration, this works
int x = 0;
//extremely overcomplicated code for a failsafe
while(x == 0)
{
motor(motorFR) = vexRT[Ch2];
motor(motorBR) = vexRT[Ch2];
motor(motorFL) = vexRT[Ch3];
motor(motorBL) = vexRT[Ch3];
if(vexRT[Btn8U]){
//gray x, assuming its due to it being in the if statement
int x = 1;
}
else if(vexRT[Btn8D]){
//gray x, assuming its due to it being in the if statement
int x = 2;
}
else {
}
}
while(x == 1){
motor(motorFR) = vexRT[Ch2];
motor(motorFL) = vexRT[Ch3];
if(vexRT[Btn8L]){
//gray x, assuming its due to it being in the if statement
int x = 0;
}
else if(vexRT[Btn8D]){
//gray x, assuming its due to it being in the if statement
int x = 2;
}
else {
}
}
while(x == 2) {
motor(motorBR) = vexRT[Ch2];
motor(motorBL) = vexRT[Ch3];
if(vexRT[Btn8U]){
//gray x, assuming its due to it being in the if statement
int x = 1;
}
else if(vexRT[Btn8L]){
//gray x, assuming its due to it being in the if statement
int x = 0;
}
else {
}
}
}