immibis

Looped RFID example

Aug 31st, 2012
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local reader = peripheral.wrap("right")
  2.  
  3. while true do
  4.  reader.scan()
  5.  while true do
  6.   local evt, p1 = os.pullEvent()
  7.   if evt == "rfid_scan_done" then
  8.    break
  9.   elseif evt == "rfid_detected" then
  10.    print("Card found: "..p1)
  11.   end
  12.  end
  13. end
Advertisement
Add Comment
Please, Sign In to add comment