help with button programming


#1

hello we are in need of help with our program. we are trying to code our catapult and ran into problems. when we push a button it will set out potentiometer to start when its under 500 and stop when its over 2000

if (vexRT[Btn7L] == 1) && SensorValue(potentiometer) < 500)
{
motor[port10] = 84;
motor[port5] = 84;

					}
					else if (SensorValue(potentiometer) < 2000)
					{ 
						motor[port10] = 0;
						motor[port5] = 0;
					} 
					else						
					{
						motor[port10] = 0;
						motor[port5] = 0;<br>![errors.PNG|567x134](upload://qmLpUqBsgfU4L0aW9YGPxhALKJK.png)

#2

I assume you have this sorted out by now, however, the first “if” statement is missing a parenthesis


if (vexRT[Btn7L] == 1) && SensorValue(potentiometer) < 500)

should be


if ( (vexRT[Btn7L] == 1) && SensorValue(potentiometer) < 500 )