-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRGB5.bas
85 lines (66 loc) · 1.23 KB
/
RGB5.bas
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#picaxe 20x2
#no_table
#no_data
inicio:
setfreq m64
low b.1 ' VERDE DIREITA
low b.4
count b.3,50,w4
high b.4
count b.3,50,w5
high 1
count b.3,50,w6
low b.2 ' VERDE ESQUERDA
low b.5
count b.6,50,w1
high b.5
count b.6,50,w2
high 2
count b.6,50,w3
readadc10 c.3,w7 ' ###### c.2 esquerda c.3 - Direitay7
setfreq m8
;debug
pause 1
if w1>3 and w1<11 and w2>5 and w2<14 and w3>11 and w3<22 and w4>4 and w4<12 and w5>6 and w5<14 and w6>11 and w6<22 then verde_de
if w1>3 and w1<11 and w2>5 and w2<14 and w3>11 and w3<22 then verde_dir
if w4 >4 and w4<12 and w5>6 and w5<14 and w6>11 and w6<22 then verde_esq
if w7>510 then prateado
if w1<500 and w2<500 and w3<500 and w4<500 and w5<500 and w6<500 and w7<500 then apagado
serout c.5,n76800_64,(0,0,0,0)
goto inicio
verde_de:
high c.0
high c.1
low c.4
serout c.5,n76800_64,(0,0,1,0)
goto inicio
verde_dir:
b21=w1
b22=w2
b23=w3
low c.0
low c.4
high c.1
serout c.5,n76800_64,(0,1,0,0)
goto inicio
verde_esq:
b24=w4
b25=w5
b26=w6
high c.0
low c.1
low c.4
serout c.5,n76800_64,(1,0,0,0)
goto inicio
prateado:
low c.0
low c.1
high c.4
serout c.5,n76800_64,(0,0,0,1)
goto inicio
apagado:
low c.0
low c.1
low c.4
serout c.5,n76800_64,(0,0,0,0)
goto inicio