Robot
void OverBall() {
RotateMotorEx (OUT_AB, -95, 194, 0, true, true);
RotateMotorEx (OUT_AB, 95, 609, 0, true, true);
}
void ColorBall() {
SetSensorColorFull(S1); // redacted
SetSensorLowspeed(S2);
int color = SENSOR_1;
this.color = color;
switch (color) {
case 2:
RotateMotor(OUT_C, -90, 85);
Wait(1500);
PlayTone(500, 100);
Wait(400);
OverBall();
break;
default:
PlayTone (1000, 300);
Wait (400);
}
}
void PickUpBall() {
RotateMotorEx (OUT_AB, 50, 194, 0, true, true);
PlayTone(1000, 300);
Wait(300);
RotateMotor (OUT_C, 95, 85);
ColorBall();
}
task main() {
SetSensorLowspeed(S2);
int x=SENSOR_2;
while(x<10) {
OnFwd(OUT_AB);
}
PickUpBall();
}
Комментарии:
Нету комментариев для вывода...