Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- task main() {
- SetSensorLowspeed(IN_1);
- SetSensorLowspeed(IN_4);
- while (true) {
- if (SensorUS(IN_4) < 15) {
- if (SensorUS(IN_1) > 25) {
- OnFwd(OUT_BC, 50);
- Wait(400);
- OnRev(OUT_C, 50);
- Wait(800);
- } else {
- OnFwd(OUT_BC, 50);
- Wait(600);
- OnRev(OUT_C, 50);
- Wait(1400);
- }
- } else if (SensorUS(IN_1) < 15) {
- if (SensorUS(IN_4) > 25) {
- OnFwd(OUT_BC, 50);
- Wait(400);
- OnRev(OUT_B, 50);
- Wait(800);
- } else {
- OnFwd(OUT_BC, 50);
- Wait(600);
- OnRev(OUT_B, 50);
- Wait(1400);
- }
- } else {
- OnRev(OUT_BC, 50);
- }
- }
- //ClearScreen();
- //TextOut(15, LCD_LINE1, "Display", true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement