Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Program pro sedmisegmentovy display
- --Verze 1.0.1
- --Vytvoril SVty
- --http://pastebin.com/u/SVty
- --http://www.youtube.com/user/SVtyPlay
- --***********************
- rednet.open("back")
- num = { 63, 6, 91, 79, 102, 109, 125, 7, 127, 111, 0 }
- while true do
- id, y = rednet.receive()
- print(y)
- y = tonumber(y)
- if y > 999 then
- for rep=1,3 do
- rs.setBundledOutput("right",(127-6))
- rs.setBundledOutput("top",(16+64))
- rs.setBundledOutput("left",(16+64))
- sleep(1)
- rs.setBundledOutput("right",0)
- rs.setBundledOutput("top",0)
- rs.setBundledOutput("left",0)
- sleep(0.5)
- end
- else
- x = y
- end
- a = math.floor(x / 100)
- b = math.floor((x - (a * 100)) / 10)
- c = math.floor(((x - (a * 100))-(b * 10)))
- if a == 0 then
- a = 10
- end
- if a == 10 and b == 0 then
- b = 10
- end
- print(a)
- print(b)
- print(c)
- rs.setBundledOutput("right",num[a + 1])
- rs.setBundledOutput("top",num[b + 1])
- rs.setBundledOutput("left",num[c + 1])
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment