1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
#pragma config(Motor, port2, frontRightMotor, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port3, backRightMotor, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port4, frontLeftMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port5, backLeftMotor, tmotorServoContinuousRotation, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
while(vexRT[Btn5U] == 0)
//right first trigger not press
{}
while(vexRT[Btn5U] == 1)
//right first trigger press
{
motor[port2] = 63;
motor[port3] = 63;
motor[port4] = 63;
motor[port5] = 63;
wait1Msec(250);
motor[port2] = 0;
motor[port3] = 0;
motor[port4] = 0;
motor[port5] = 0;
wait1Msec(500);
int Left = 0;
while(Left != 4)
{
motor[port2] = 63;
motor[port3] = 63;
motor[port4] = -63;
motor[port5] = -63;
wait1Msec(250);
motor[port2] = 0;
motor[port3] = 0;
motor[port4] = 0;
motor[port5] = 0;
wait1Msec(500);
Left = Left + 1;
}
int Right = 0;
while(Right != 4)
{
motor[port2] = -63;
motor[port3] = -63;
motor[port4] = 63;
motor[port5] = 63;
wait1Msec(250);
motor[port2] = 0;
motor[port3] = 0;
motor[port4] = 0;
motor[port5] = 0;
wait1Msec(500);
Right = Right + 1;
}
}
}
|