-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrobo_line_follower.g7.xml
65 lines (65 loc) · 2.39 KB
/
robo_line_follower.g7.xml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?xml version="1.0" encoding="ISO-8859-1" ?>
<G7Project>
<Graph>
<Objects>
<Obj Name="X1" Page="0" CellX="1" CellY="4" BarInIdx="0" BarOutIdx="1" Type="1" Flags="1">
<Code>
</Code>
<Text>
</Text>
</Obj>
<Obj Name="t0" Page="0" CellX="1" CellY="6" BarInIdx="1" BarOutIdx="2" Type="2" Flags="0">
<Code>
i1
</Code>
<Text>
</Text>
</Obj>
<Obj Name="X2" Page="0" CellX="1" CellY="8" BarInIdx="2" BarOutIdx="3" Type="1" Flags="0">
<Code>
</Code>
<Text>
</Text>
</Obj>
<Obj Name="t1" Page="0" CellX="1" CellY="10" BarInIdx="3" BarOutIdx="4" Type="2" Flags="0">
<Code>
i0 or i2
</Code>
<Text>
</Text>
</Obj>
<Obj Name="Jump0" Page="0" CellX="0" CellY="12" BarInIdx="4" BarOutIdx="-1" Type="4" Flags="2">
<Code>
</Code>
<Text>
</Text>
</Obj>
<Obj Name="Jump0" Page="0" CellX="0" CellY="2" BarInIdx="-1" BarOutIdx="0" Type="5" Flags="0">
<Code>
</Code>
<Text>
</Text>
</Obj>
<Obj Name="Zone8" Page="0" CellX="0" CellY="0" BarInIdx="-1" BarOutIdx="-1" Type="1" Flags="0">
<Code>
v := 160 - 0.03 * abs(2000.0 - position);<br/>w := -0.05 * (2000.0 - position);<br/>v1 := v + w;<br/>v2 := v - w;<br/>if (v1 >255) then v1:= 255; end_if;<br/>if (v1<-255) then v1:=-255; end_if;<br/>if (v2 >255) then v2:= 255; end_if;<br/>if (v2<-255) then v2:=-255; end_if;<br/>if x2 then<br/>set_motors(v1, v2);<br/>else<br/>set_motors(0, 0);<br/>end_if;<br/>if ((sw0 % 50)=0) then<br/>clear();<br/>printf("%3d %3d",v1,v2);<br/>lcd_goto_xy(0,1);<br/>printf("%04d %d%d", position, X1, X2);<br/>end_if;
</Code>
<Text>
</Text>
</Obj>
<Obj Name="Zone1" Page="0" CellX="1" CellY="0" BarInIdx="-1" BarOutIdx="-1" Type="1" Flags="0">
<Code>
if (sw0=0) then<br/>calibrate();<br/>end_if;
</Code>
<Text>
</Text>
</Obj>
<Obj Name="X3" Page="0" CellX="0" CellY="16" BarInIdx="-1" BarOutIdx="-1" Type="1" Flags="0">
<Code>
</Code>
<Text>
</Text>
</Obj>
</Objects>
</Graph>
</G7Project>