-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrobot_follow_wall.g7.xml
54 lines (54 loc) · 1.83 KB
/
robot_follow_wall.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
<?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>
set_motors(0, 0);
</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>
position := read_trimpot();<br/>v := 40;<br/>w := -0.1 * (300.0 - position);<br/>v1 := v + w;<br/>v2 := v - w;<br/><br/>set_motors(v1, v2);
</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>
if ((sw0 % 50)=0) then<br/>//lcd_goto_xy(0,1);<br/>clear();<br/>printf("%3d %3d",v1,v2);<br/>lcd_goto_xy(0,1);<br/>//printf("%4d %d %d", position, X1, X2);<br/>print_long(position);<br/>end_if;
</Code>
<Text>
</Text>
</Obj>
</Objects>
</Graph>
</G7Project>