How to make button command in reverse?

I have the button command but i don’t know how to make it go backwards. I need some help. Here is the code task main()
{

while(1==1)
{
	if(vexRT[Btn8D] == 1)  // if Btn8D is pressed:
	{
		motor(port1)=127;

	}
	else
	{
		motor(port1)=0;
	}
}

{
	if(vexRT[Btn8R] == 1)  // if Btn8D is pressed:
	{
		motor(port1)=-127;

	}
	else
	{
		motor(port1)=0;
	}
}
}

We need help quick we have a comp next Saturday

check your brackets

they’re a mess and arent grouping the right things together

What do you mean?

You have a few extra brackets

This should fix it:


task main(){
	while(1==1){
		if (vexRT[Btn8D] == 1){ // if Btn8D is pressed:
			motor(port1)=127;
		}
		else if (vexRT[Btn8R] == 1){ // if Btn8R is pressed:
			motor[port1] = -127;	
		}
		else{
			motor(port1)=0;
		}
	}
}

eggplant fixed it for you but you closed your while loop before you got to the reverse button so you would never be able to reverse as it isn’t reading for that button