View difference between Paste ID: x1mPwWgs and rF87udz3
SHOW: | | - or go back to the newest paste.
1-
rfid = peripheral.wrap("back")
1+
rfid = peripheral.wrap("rfid reader_7")
2-
other = peripheral.wrap("mag card reader_0")
2+
data = "open_ses"
3-
p = peripheral.wrap("bottom")
3+
4-
data = "open_later"
4+
5
rs.setOutput("left", true)
6-
function on()
6+
rfid.scan(2)
7-
  rfid.setInsertCardLight(true)
7+
event, p1 = os.pullEvent()
8-
  other.setInsertCardLight(true)
8+
if event == "rfid_detected" then
9
if p1 == data then
10
rs.setOutput("left", false)
11-
function off()
11+
sleep(1)
12-
  rfid.setInsertCardLight(false)
12+
rs.setOutput("left", true)
13-
  other.setInsertCardLight(false)
13+
14
end
15
sleep(0.1)
16-
function hash(text)               
16+