Subversion Repositories svnkaklik

Rev

Rev 276 | Rev 278 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 276 Rev 277
Line 1... Line 1...
1
program Orbis;
1
program Orbis;
2
 
2
 
3
var line, Rychlost;
3
var line, movement, Rychlost;
4
 
4
 
5
#define L 1
5
#define L 1
6
#define S 2
6
#define S 2
7
#define R 3
7
#define R 3
8
 
8
 
Line 10... Line 10...
10
 
10
 
11
Rychlost:=15;		# omezeni rychlosti (hlavne pro ladici ucely)
11
Rychlost:=15;		# omezeni rychlosti (hlavne pro ladici ucely)
12
 
12
 
13
while true
13
while true
14
do
14
do
15
  if LEYE > 0 and CEYE > 0 then		# Cara pod levim sensorem
15
  if LEYE = 1 and CEYE = 1 and REYE = 0 then 
16
    LMOT:=0;RMOT:=Rychlost;			# jed rovne
16
    LMOT:=0;RMOT:=Rychlost;			# jed rovne
17
    line:=1;		# zaznamenej, kdes videl caru
17
    line:=1;		# zaznamenej, kdes videl caru
-
 
18
    movement:=1;
18
    continue;
19
    continue;
19
  end;
20
  end;
20
 
21
 
-
 
22
  if LEYE = 0 and CEYE = 1 and REYE = 1 then 
-
 
23
    LMOT:=Rychlost;RMOT:=Rychlost;
-
 
24
    line:=3;
-
 
25
    movement:=2;
-
 
26
    continue;
-
 
27
  end;
-
 
28
 
-
 
29
  if LEYE = 1 and CEYE = 0 and REYE = 0 then 
-
 
30
    LMOT:=0;RMOT:=Rychlost;			# jed rovne
-
 
31
    line:=1;		# zaznamenej, kdes videl caru
-
 
32
    movement:=1;
-
 
33
    continue;
-
 
34
  end;
-
 
35
 
21
  if REYE > 0 and CEYE > 0 then
36
  if LEYE = 0 and CEYE = 0 and REYE = 1 then 
22
    LMOT:=Rychlost;RMOT:=0;
37
    LMOT:=Rychlost;RMOT:=0;
23
    line:=3;
38
    line:=3;
-
 
39
    movement:=3;
24
    continue;
40
    continue;
25
  end;
41
  end;
26
 
42
 
27
  if CEYE > 0 then 
43
  if (LEYE = 0 and CEYE = 1 and REYE = 0) then 
28
    LMOT:=Rychlost;RMOT:=Rychlost;
44
    LMOT:=0;RMOT:=Rychlost;
29
    line:=2;
45
    line:=2;
-
 
46
    movement:=1;
30
    continue;
47
    continue;
31
  end;
48
  end;
32
  
49
 
-
 
50
  if (LEYE = 1 and CEYE = 1 and REYE = 1) then 
-
 
51
    LMOT:=0;RMOT:=Rychlost;
-
 
52
    line:=2;
-
 
53
    movement:=1;
-
 
54
    continue;
-
 
55
  end;
-
 
56
 
-
 
57
  if (LEYE = 0 and CEYE = 0 and REYE = 0) then 
-
 
58
      LMOT:=Rychlost;RMOT:=0;
-
 
59
      line:=2;
-
 
60
      movement:=3;
-
 
61
  end;    
33
end;
62
end;