This repository was archived by the owner on May 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjTest.script
More file actions
40 lines (35 loc) · 1.49 KB
/
objTest.script
File metadata and controls
40 lines (35 loc) · 1.49 KB
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
syscall(cleardisplay, "");
until(syscall(getbutton,"e") == 1){
syscall(setcursorstartx, itos(10));
syscall(setcursorstarty, itos(10));
syscall(drawtext, "Left Front: ");
syscall(setcursorstarty, itos(20));
syscall(drawtext, syscall(irleftfront, "")+" ");
syscall(setcursorstartx, itos(10));
syscall(setcursorstarty, itos(40));
syscall(drawtext, "Right Front: ");
syscall(setcursorstarty, itos(50));
syscall(drawtext, syscall(irrightfront, "")+" ");
if (stoi(syscall(irleftfront, ""))<50 && stoi(syscall(irrightfront, ""))<50){
if (stoi(syscall(irleftfront, ""))<stoi(syscall(irrightfront, ""))){
syscall(motorleftset, itos(100));
syscall(motorrightset, itos(-100));
}
if (stoi(syscall(irleftfront, ""))>stoi(syscall(irrightfront, ""))){
syscall(motorrightset, itos(100));
syscall(motorleftset, itos(-100));
}
}
else if (stoi(syscall(irleftfront, ""))<50){
syscall(motorleftset, itos(100));
syscall(motorrightset, itos(-100));
}
else if (stoi(syscall(irrightfront, ""))<50){
syscall(motorrightset, itos(100));
syscall(motorleftset, itos(-100));
}
else{
syscall(motorleftset, itos(100));
syscall(motorrightset, itos(100));
}
}