Our robot has a scissor lift that keeps tipping over. we have petentiometers. our program is this.
if(vexRT[Btn6U] == 1)
{
SensorValue[PnumaticsL] = 1;
SensorValue[PnumaticsR] = 1;
if(Pet > Pet2)
{
motor[liftL1] = 105;
motor[liftL2] = 105;
motor[liftR1] = 0;
motor[liftR2] = 0;
}
else if(Pet < Pet2)
{
motor[liftL1] = 0;
motor[liftL2] = 0;
motor[liftR1] = 105;
motor[liftR2] = 105;
}
//motor[liftR1] = 127;
//motor[liftL1] = 127; emergency lines!!!
//motor[liftR2] = 127; commenting out these lines for now
//motor[liftL2] = 127;
}
else if(vexRT[Btn6D] == 1)
{
SensorValue[PnumaticsL] = 0;
SensorValue[PnumaticsR] = 0;
if(Pet < Pet2)
{
motor[liftL1] = -105;
motor[liftL2] = -105;
motor[liftR1] = 0;
motor[liftR2] = 0;
}
else if(Pet > Pet2)
{
motor[liftL1] = 0;
motor[liftL2] = 0;
motor[liftR1] = -105;
motor[liftR2] = -105;
}
//motor[liftR1] = -127; emergency lines!!!
//motor[liftL1] = -127;
//motor[liftR2] = -127; commenting out these lines for now
//motor[liftL2] = -127;
}
else
{
SensorValue[PnumaticsL] = 0;
SensorValue[PnumaticsR] = 0;
motor[liftR1] = 0;
motor[liftL1] = 0;
motor[liftR2] = 0;
motor[liftL2] = 0;
}