RFID Reader documentation v2.1

Copyright © Parallax Inc. RFID Card Reader Serial & USB (#28140 / 28340) v2.1 8/28/2008 Page 11 of 11
Bad_Char: ' try next tag
NEXT
Bad_Tag:
tagNum = 0
GOSUB Show_Name ' print message
FREQOUT Spkr, 1000 */ TmAdj, 115 */ FrAdj ' groan
PAUSE 1000
GOTO Main
Tag_Found:
GOSUB Show_Name ' print name
HIGH Latch ' remove latch
FREQOUT Spkr, 2000 */ TmAdj, 880 */ FrAdj ' beep
LOW Latch ' restore latch
GOTO Main
END
' -----[ Subroutines ]-----------------------------------------------------
' Prints name associated with RFID tag
Show_Name:
DEBUG DEC tagNum, ": "
LOOKUP tagNum,
[Name0, Name1, Name2, Name3], idx ' point to first character
DO
READ idx, char ' read character from name
IF (char = 0) THEN EXIT ' if 0, we're done
DEBUG char ' otherwise print it
idx = idx + 1 ' point to next character
LOOP
RETURN