-
Notifications
You must be signed in to change notification settings - Fork 0
/
ex_03.ceu
66 lines (61 loc) · 948 Bytes
/
ex_03.ceu
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
66
input int PIN02, PIN03;
output int PIN13;
var int dt = 1000;
loop do
par/or do
loop do
emit PIN13 => _HIGH;
await (dt)ms;
emit PIN13 => _LOW;
await (dt)ms;
end
with
loop do
var int on = await PIN02
until on and (dt > 200);
dt = dt - 100;
await 50ms;
end
with
loop do
var int on = await PIN03
until on;
dt = dt + 100;
await 50ms;
end
with
loop do
par/or do
par/and do
await PIN02;
with
await PIN03;
end
break;
with
par/or do
await PIN02;
with
await PIN03;
end
await 500ms;
end
end
end
// Botão ressucitar
loop do
// Espera o botão s0er apertado
do var int v = await PIN02
until v==_HIGH;
end
par/or do
// Espera o botão ser solto
do var int v = await PIN02
until v==_LOW;
end
with
await 5000ms;
break;
end
end
end