Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local b = false
- function flipFlop()
- while true do
- r = colors.test (redstone.getBundledInput("top"), colors.red)
- g = colors.test (redstone.getBundledInput("top"), colors.green)
- if g == false then
- if r == false or b == true
- then b = true
- end
- else
- b = false
- end
- printInfo(r, g, b)
- if b == true then
- redstone.setBundledOutput("top", colors.blue)
- else
- redstone.setBundledOutput("top", 0)
- end
- os.sleep (5)
- end
- end
- function printInfo(r, g, b)
- term.clear()
- term.setCursorPos(1,1)
- print("Low-Level: " .. tostring(r))
- term.setCursorPos(20,1)
- print("High-Level: " .. tostring(g))
- term.setCursorPos(1,3)
- print("output: " .. tostring(b))
- end
- flipFlop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement