Shop OBEX P1 Docs P2 Docs Learn Events
Any suggestions for having the RFID tag create tag streams? — Parallax Forums

Any suggestions for having the RFID tag create tag streams?

Buck RogersBuck Rogers Posts: 2,175
edited 2010-09-12 10:47 in Accessories

Hello!
I have (re)assembled the demo for the RFID reader. :hop: I've run the demo program as written against the rectangular tag that came with it. And against the four I bought the same time as the USB adapter.

The problem now is to have the program produce the numbers assigned to the tag in question, unformatted. I basically want to see a stream of numbers that each tag is wearing.

Let's say a present the tag numbered 456 to the reader. Then the debug window would show me that number. The key here is that I would want to see the numbers like that. :confused:

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-09-01 22:55
    Not sure what you mean. the tag reader always returns the id on the tag. What you do on the stamp with that info is up to you. If you had a line like
    if tag = 12345 then debug "hello Dave" you could code that.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2010-09-02 13:35
    Here is something that might help

    Show_Name:


    DEBUG DEC tagNum, ": " , ....>>>>> this line shows tag ID #


    ' You can try this >>> DEBUG "TAG ID:", STR buf\10, CR <<<<<<



    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



    And if you want to have each card do something different then use this


    Tag_Found:

    ON tagNum GOSUB Routine0, Routine1, Routine2, Routine3


    Routine0:
    Your code here
  • Buck RogersBuck Rogers Posts: 2,175
    edited 2010-09-12 10:47

    Hello!
    And as it happens after a brief delay, when I spent the time working with the stamp on two other things, I have gotten it to respond accordingly.
    ' =========================================================================
    '
    '   File....... RFID_basic.BS1
    '   Purpose.... RFID Tag Reader
    '   Author..... (c) Parallax, Inc. -- All Rights Reserved
    '   E-mail..... support@parallax.com
    '   Started....
    '   Updated.... 07 FEB 2005
    '
    '   {$STAMP BS1}
    '   {$PBASIC 1.0}
    '
    ' =========================================================================
    
    
    ' -----[ 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.
    
    
    ' -----[ Revision History ]------------------------------------------------
    
    
    ' -----[ I/O Definitions ]-------------------------------------------------
    
    SYMBOL  Enable          = 0                     ' low = reader on
    SYMBOL  RX              = 1                     ' serial from reader
    
    
    
    ' -----[ Constants ]-------------------------------------------------------
    
    
    
    
    ' -----[ Variables ]-------------------------------------------------------
    
    SYMBOL  tag0            = B0                    ' RFID bytes buffer
    SYMBOL  tag1            = B1
    SYMBOL  tag2            = B2
    SYMBOL  tag3            = B3
    SYMBOL  tag4            = B4
    SYMBOL  tag5            = B5
    SYMBOL  tag6            = B6
    SYMBOL  tag7            = B7
    SYMBOL  tag8            = B8
    SYMBOL  tag9            = B9
    
    SYMBOL  tagNum          = B10                   ' from EEPROM table
    SYMBOL  pntr            = B11                   ' pointer to char in table
    SYMBOL  char            = B12                   ' character from table
    
    
    
    
    ' -----[ Initialization ]--------------------------------------------------
    
    Reset:
      HIGH Enable                                   ' turn off RFID reader
    
    
    
    ' -----[ Program Code ]----------------------------------------------------
    
    Main:
    PAUSE 100
      LOW Enable                                    ' activate the reader
      SERIN RX, T2400, ($0A)                        ' wait for header
      SERIN RX, T2400, tag0, tag1, tag2, tag3, tag4 ' get tag bytes
      SERIN RX, T2400, tag5, tag6, tag7, tag8, tag9
      PAUSE 100
     HIGH Enable                                   ' deactivate reader
    
    Display_Tag:
    'DEBUG "Tag Identification number is: ",#tag0,#tag1,#tag2,#tag3,#tag4,#tag5,#tag6,#tag7,#tag8,#tag9,CR
      DEBUG #tag0,#tag1,#tag2,#tag3,#tag4,#tag5,#tag6,#tag7,#tag8,#tag9
      SEROUT 7, T2400, (tag0, tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9)
     GOTO main
    
    
    
    ' -----[ Subroutines ]-----------------------------------------------------
    
    
    It was easier to adapt the existing demo program to what I need. I have pin seven on the stamp sending out my data from the tags via the classic serial output routines. :smilewinkgrin:
    Ideally making the rest work from that will be the big step. This is taking place with one of the sensors bought earlier.












Sign In or Register to comment.