RFID Reader documentation v2.1
Copyright © Parallax Inc. RFID Card Reader Serial & USB (#28140 / 28340) v2.1 8/28/2008 Page 8 of 11
pntr = tagNum * 10 + 1 : READ pntr, char
IF char <> tag1 THEN Bad_Char
pntr = tagNum * 10 + 2 : READ pntr, char
IF char <> tag2 THEN Bad_Char
pntr = tagNum * 10 + 3 : READ pntr, char
IF char <> tag3 THEN Bad_Char
pntr = tagNum * 10 + 4 : READ pntr, char
IF char <> tag4 THEN Bad_Char
pntr = tagNum * 10 + 5 : READ pntr, char
IF char <> tag5 THEN Bad_Char
pntr = tagNum * 10 + 6 : READ pntr, char
IF char <> tag6 THEN Bad_Char
pntr = tagNum * 10 + 7 : READ pntr, char
IF char <> tag7 THEN Bad_Char
pntr = tagNum * 10 + 8 : READ pntr, char
IF char <> tag8 THEN Bad_Char
pntr = tagNum * 10 + 9 : READ pntr, char
IF char <> tag9 THEN Bad_Char
GOTO Tag_Found ' all match -- good tag
Bad_Char:
NEXT
Bad_Tag:
SOUND Spkr, (25, 80) ' groan
PAUSE 1000
GOTO Main
Tag_Found:
DEBUG #tagNum, CR ' for testing
HIGH Latch ' remove latch
SOUND Spkr, (114, 165) ' beep
LOW Latch ' restore latch
GOTO Main
END
BASIC Stamp
®
2 Program
The following code examples read tags from a RFID Card Reader and compare the values to known tags
(stored in an EEPROM table).
' =========================================================================
'
' File....... RFID.BS2
' Purpose.... RFID Tag Reader / Simple Security System
' Author..... (c) Parallax, Inc. -- All Rights Reserved
' E-mail..... support@parallax.com
' Started....
' Updated.... 07 FEB 2005
'
' {$STAMP BS2}
' {$PBASIC 2.5}
'
' =========================================================================
' -----[ Program Description ]---------------------------------------------
'
' Reads tags from a Parallax RFID reader and compares to known tags (stored
' in EEPROM table). If tag is found, the program will disable a lock.