Programming buttons

Hi! I can’t get the arms to work using buttons. It’s not a motor problem because I tried it on a different port and the arms work then (Ch1 & 2). But using buttons it won’t work. I also tried the claw and the same thing happened - it works in port 2 using channels 1 & 2 on the joystick. But when I use buttons on the joystick it won’t work. It won’t let me attach a file. I pasted a copy of the button programming. Can you give me any suggestions?
if (vexRT[Btn5U]==1)
{
motor[LeftArm]=127;

	}
	else if (vexRT[Btn5D]==1)
	{
		motor[LeftArm]=-127;
		}
	else
	{
		motor[LeftArm]=0;
	}
	if (vexRT[Btn6U]==1)
	{
		motor[RightArm]=127;

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

It looks like you had some suggestions from the community here.
https://vexforum.com/t/unofficial-answer-to-programming-buttons/43424/1

Without seeing the entire program it’s hard to determine what may be wrong.
Make sure you have the code within the while loop in your driver control program.
Make sure you are not trying to control the same motors elsewhere in the same loop, for example, by using a joystick channel.