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
Vyx
October 13, 2018, 9:52am
#3
check your brackets
they’re a mess and arent grouping the right things together
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;
}
}
}
Vyx
October 13, 2018, 12:10pm
#6
Asomekid1031:
What do you mean?
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