button program

Hello I am trying to program a button to my remote but it will not work any feed back is awesome thank you.

task main()
{
while(true)

If(vexRT[Btn6U]==1);
{
motor[rightclaw]=127;
}
else if (vexRT[Btn6D]==1)
{
motor[rightclaw]= -127;
}
else
{
motor[rightclaw]=0;
}
}

Your code looks good. Check the wiring, that would be my first guess.

Oh lol totally missed the braces for the while loop.

This is what it is saying.

The “if” needs to be lowercase…

I don’t know if RobotC is finnicky with these kinds of things, but I think you’re missing curly braces for the while loop.

Missing { } for the while loop. No?
[missed NightsRosario post – agreed with {} ]

You’re missing curly braces for the while loop. This is what your code should look like:

task main()
{
	while(true)
	{
		if(vexRT[Btn6U] == 1)
		{
			motor[rightclaw] = 127;
		}
		else if (vexRT[Btn6D] == 1)
		{
			motor[rightclaw] = -127;
		}
		else
		{
			motor[rightclaw] = 0;
		}
	}
}

Ok thank you guys for your help.