////________________________________________________________________________________________________________
//above is the code for the wheels which allows wheels to move in a 350 degrees rotation.
if(vexRT[Btn7U] == 1) //If button 7U is pressed...
{
motor[armMotor] = 127; //...raise the arm.
}
else if(vexRT[Btn7D] == 1) //Else, if button 7D is pressed...
{
motor[armMotor] = -127; //...lower the arm.
}
else //Else (neither button is pressed)...
{
motor[armMotor] = 0; //...stop the arm.
}
//////______________________________________________________________________________________________________
//above is the code for the arm which allows it to move up and down
// Open, close or do not more claw
if(vexRT[Btn6U] == 1) //If Button 6U is pressed...
{
motor[clawMotor] = 127; //...close the gripper.
}
else if(vexRT[Btn6D] == 1) //Else, if button 6D is pressed...
{
motor[clawMotor] = -127; //...open the gripper.
}
else //Else (neither button is pressed)...
{
motor[clawMotor] = 0; //...stop the gripper.
}
////_______________________________________________________________________________________________________________
//above is the code for the claw allowing it to open and close
if(vexRT[Btn7L] ==1) //If button 7L is pressed
{
motor[beltMotor] = 127; //Move the Conveyor belt forward
}
else if(vexRT[Btn7R] == 1) //Else, if button 7R is pressed...
{
motor[beltMotor] = -127; //Move the Conveyer belt backwards.
}
else //Else (neither button is pressed)...
{
motor[beltMotor] = 0; //...stop the Belt.
}
////____________________________________________________________________________________________________________
//above is the code for the conveyor belt allowing it to move back and forth
if(vexRT[Btn8R] ==1) //If button 8R is pressed
{
motor[rotationMotor] = 63; //Rotates the claw
}
else if(vexRT[Btn8L] == 1) //Else, if button 8L is pressed...
{
motor[rotationMotor] = -63; //Move the Conveyer belt backwards.
}
else //Else (neither button is pressed)...
{
motor[rotationMotor] = 0; //Dont rotate
}
}
{
if(vexRT[Btn8D] ==1)
wait1Msec(2000); // The program waits for 2000 milliseconds before continuing.
int threshold = 505; /* found by taking a reading on both DARK and LIGHT */
/* surfaces, adding them together, then dividing by 2. */
while(true)
{
// RIGHT sensor sees dark:
}
if(SensorValue(lineFollowerRIGHT) > 505)
{
// counter-steer right:
motor[frontLeft] = 63;
motor[frontRight] = 0;
}
{
// CENTER sensor sees dark:
if(SensorValue(lineFollowerCENTER) > 505)
{
// go straight
motor[frontLeft] = 63;
motor[frontRight] = 63;
}
// LEFT sensor sees dark:
if(SensorValue(lineFollowerLEFT) > 505)
{
// counter-steer left:
motor[frontLeft] = 0;
motor[frontRight] = 63;
}
else //Else (neither button is pressed)...
{
motor[frontLeft] = 0; //Dont rotate
motor[frontRight] = 0;
}
}
}