Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- inSide = tArgs[2]
- outSide = tArgs[3]
- --print(tArgs[1])
- pr = tArgs[1]
- function getRedstone(i)
- return 2*i
- end
- function getPressure(i)
- return i/2
- end
- rs = getRedstone(pr)
- print("Detecting Analog Redstone Signal level: " .. rs)
- print()
- while true do
- x = redstone.getAnalogInput(inSide)
- print("Actual pressure: " .. getPressure(x))
- if x >= rs then
- redstone.setOutput(outSide, false)
- redstone.setBundledOutput(outSide, 0)
- else
- redstone.setOutput(outSide, true)
- redstone.setBundledOutput(outSide, 1)
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment