So our test potentiometer code is set to run a motor when a button is pressed and the sensor is less then a set value. When we push the button though, nothing happens. Code is written as follows:
#pragma config(Sensor, in1, potentiometer1, sensorPotentiometer)
#pragma config(Motor, port6, motor1, tmotorNormal, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
while(true)
{
if(vexRT[Btn5U] == 1)
{
if(SensorValue[potentiometer1] < 4000)
{
motor[motor1] = 31;
}
else
{
motor[motor1] = 0;
}
}
if (vexRT[Btn5D] == 1)
{
if(SensorValue[potentiometer1] > 10)
{
motor[motor1] = -31;
}
else
{
motor[motor1] = 0;
}
}
}
}