Пример #1
0
void liftControl() {
	if (isLiftUp())
	{
		liftUp();
		PlaySound(soundUpwardTones);
	}
	else if (isLiftDown())
	{
		liftDown();
		PlaySound(soundDownwardTones);
	}
	else
	{
		liftStop();
		ClearSounds();
	}
}
Пример #2
0
void progSkills()
{
	//while (SensorValue[bumper] == 0) {}
	SensorValue[rightBackS] = 0;
	while (abs(SensorValue[rightBackS]) < 70) moveStraight(-90);
	baseStop();
	// Deploy
	deploy();

	moveLiftAuto(1,3100);
	moveLift(20);
	SensorValue[rightBackS] = 0;
	while (abs(SensorValue[rightBackS]) < 40) moveStraight(40);
	baseStop();
	/*
	moveStraight(127);
	wait1Msec(200);
	moveStraight(-127);
	wait1Msec(200);
	*/
	moveStraight(127);
	wait1Msec(200);
	intake(-1);
	moveStraight(	-127);
	wait1Msec(200);
	baseStop();

	//intake(-1);
	wait1Msec(2000);

	moveStraight(50);
	wait1Msec(100);
	baseStop();

	intake(1);
	moveLift(-30);
	wait1Msec(500);
	intake(0);

	liftStop();
	moveStraight(-40);
	wait1Msec(200);
	baseStop();

	SensorValue[leftBackS] = 0;
	SensorValue[rightBackS] = 0;
	while (((abs(SensorValue[leftBackS])+abs(SensorValue[rightBackS]))/2) < 450)
	{
		while (SensorValue[rightLiftS] < 4000)
		{
			moveLift(-70);
			turnOnSpot(2,90);
		}
		liftStop();
	}
	baseStop();
	intake(1);
	moveStraight(70);
	wait1Msec(1000);
	baseStop();

	SensorValue[leftBackS] = 0;
	SensorValue[rightBackS] = 0;
	while (((abs(SensorValue[leftBackS])+abs(SensorValue[rightBackS]))/2) < 500)
	{
		turnOnSpot(2,90);
	}
	baseStop();
	moveStraight(127);
	wait1Msec(2000);
	baseStop();

	while(SensorValue[bumper] == 0) {}
	intake(-1);

	while(SensorValue[bumper] == 0) {}
	intake(0);
	// Raise Lift
	// Output

	while(SensorValue[bumper] == 0) {}
	intake (1);
	moveStraight(127);
	wait10Msec(50);
	turnOnSpot(1,60);
	wait10Msec(30);
	turnOnSpot(2,60);
	wait10Msec(30);
	baseStop();

	SensorValue[leftBackS] = 0;
	SensorValue[rightBackS] = 0;
	while (((abs(SensorValue[leftBackS])+abs(SensorValue[rightBackS]))/2) < 500)
	{
		turnOnSpot(1,90);
	}
	intake(-1);
	wait10Msec(100);
}