View difference between Paste ID: paG2CHtc and Y2VUtcXc
SHOW: | | - or go back to the newest paste.
1
m=peripheral.wrap("back")
2
a=0
3
b=0
4
c=0
5
6
while true do
7
m.setBackgroundColor(colors.black)
8
m.clear()
9
m.setCursorPos(1,1)
10
m.setTextColor(colors.white)
11
12
if a==0 then 
13
rs.setOutput("right",true)
14
m.setBackgroundColor(colors.red)
15
m.write("Wand nach hinten")
16
else
17
rs.setOutput("right",false)
18
m.setBackgroundColor(colors.green)
19
m.write("Wand nach vorne")
20
end
21
22
m.setCursorPos(1,3)
23
if b==0 then 
24
rs.setOutput("top",false)
25
m.setBackgroundColor(colors.red)
26
m.write("Alles Anhalten")
27
else
28
rs.setOutput("top",true)
29
m.setBackgroundColor(colors.green)
30
m.write("Betriebsbereit")
31
end
32
33
m.setCursorPos(1,5)
34
if c==0 then 
35
rs.setOutput("left",true)
36
m.setBackgroundColor(colors.red)
37
m.write("Tür zu")
38
else
39
rs.setOutput("left",false)
40
m.setBackgroundColor(colors.green)
41
m.write("Tür auf")
42
end
43
print(1)
44
event, side, xPos, yPos = os.pullEvent("monitor_touch")
45
print(1.5)
46
if yPos==1 then
47
if a==0 then
48
a=1
49
else
50
a=0
51
end
52
end
53
if yPos==3 then
54
if b==0 then
55
b=1
56
else
57
b=0
58
end
59
end
60
if yPos==5 then
61
if c==0 then
62
c=1
63
else
64
c=0
65
end
66
end
67
print(2)
68
end