Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Analog-Comparator mit Debug-Ausgabe
- -- BACK <= 7 => TOP = 15, sonst TOP = 0
- local inSide = "back"
- local outSide = "top"
- local threshold = 7
- local tickDelay = 0.2
- term.clear()
- term.setCursorPos(1,1)
- print("=== Redstone Comparator Debug ===")
- print("Input : back")
- print("Output: top")
- print("Threshold <= " .. threshold)
- print("--------------------------------")
- while true do
- local input = redstone.getAnalogInput(inSide) or 0
- local output
- if input <= threshold then
- output = 15
- redstone.setAnalogOutput(outSide, output)
- else
- output = 0
- redstone.setAnalogOutput(outSide, output)
- end
- -- Debug-Ausgabe aktualisieren
- term.setCursorPos(1,6)
- term.clearLine()
- print("Input (back): " .. input)
- term.clearLine()
- print("Output (top): " .. output)
- term.clearLine()
- if input <= threshold then
- print("State: ACTIVE (<= threshold)")
- else
- print("State: INACTIVE (> threshold)")
- end
- sleep(tickDelay)
- end
Advertisement
Add Comment
Please, Sign In to add comment