Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rfid = peripheral.wrap("rfid reader_6")
- data = "open_ses"
- while true do
- rs.setOutput("top", true)
- rfid.scan(2)
- event, p1 = os.pullEvent()
- if event == "rfid_detected" then
- if p1 == data then
- rs.setOutput("top", false)
- sleep(3)
- rs.setOutput("top", true)
- end
- end
- if event == "mag_swipe" then
- if p1 == data then
- rs.setOutput("top", false)
- sleep(3)
- rs.setOutput("top", true)
- end
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement