RFIDuino Library Documentation

The following functions are available in the RFIDuino Library for Arduino. The library is compatible and has been tested with Arduino 1.0.6.

scanForTag

Syntax:

cardCheck = myRFIDuino.scanForTag(tagData)

Description:

This function is a high level wrapper for several functions that scan and verify tags.

The scanForTag() function continuously scans for a tag. The scanForTag() actually needs to run a least twice to be successful. This is because the library needs to read a tag twice to verify the data and prevent 'phantom reads'. The reading process happens very fast, so you won't even notice that the tag is being read multiple times.

If scanForTag() has run at least twice and returned the same data, it will return a 'true' value and place the ID numbers it has read into the array tagData.

If you are interested in learning more about how and why this function works, see the old Hello World Examples, #1, #2 and #3,

scan for a RFID tag being swiped across the RFIDuino antenna. Once a tag has been detected, this function will decode the tag's response into the a 5-byte ID number. This number will then be stored in the reference array, tagData

Parameters:

tagData, a reference to an array of bytes that will hold the ID of the tag

Returns:

A boolean value true if a tag is successfully read. Otherwise a false is returned

decodeTag

Syntax:

cardCheck = myRFIDuino.decodeTag(tagData)

Description:

This low level function will scan for a RFID tag being swiped across the RFIDuino antenna. Once a tag has been detected, this function will decode the tag's response into the a 5-byte ID number. This number will then be stored in the reference array, tagData

It is possible for this function to read 'phantom tags', tags that don't actually exist, but are the EM4095 chip interpetting Electromagnetic Interference as valid tag data. Data procured with this function should be verified with a second decodeTag() function call.

Parameters:

tagData, a reference to an array of bytes that will hold the ID of the tag

Returns:

A boolean value true if a tag is successfully read. Otherwise a false is returned

Notes:

This function uses the manchester decoding method to convert the tag's response into usable data. See here for a more technical analysis of this decoding method.

transferToBuffer

Syntax:

myRFIDuino.transferToBuffer(tagData, tagData_buffer)

Description:

Transfers the contents of tagData to tagData_buffer.

Parameters:

tagData, a array of 5 bytes, is the transfer source.
tagData_buffer, a array of 5 bytes, is the transfer target.

Returns:

None

Notes:

This function is a basic loop that moves each value from tagData to tagData_buffer.

compareTagData

Syntax:

myRFIDuino.compareTagData(tagData_1, tagData_2)

Description:

Compares the two arrays tagData_1 and tagData_2.

Parameters:

< span class="codePhrase">tagData_1, a array of 5 bytes
tagData_2, a array of 5 bytes.

Returns:

A boolean true if both arrays are identical. Otherwise a false is returned.

Notes:

This function is a basic loop that compares each value in the two arrays against each other.

errorSound

Syntax:

myRFIDuino.errorSound()

Description:

Sound 3 monotone notes on the buzzer to indicate an error.

Parameters:

None

Returns:

None

Notes:

This function uses the Arduino tone() to sound 3 notes. The note frequencies have been chosen to work with the piezo buzzer on the RFIDuino. Some frequencies may work better than others.

successSound

Syntax:

myRFIDuino.successSound()

Description:

Sound 3 melodic notes on the buzzer to indicate a successful event.

Parameters:

None

Returns:

None

Notes:

This function uses the Arduino tone() to sound 3 notes. The note frequencies have been chosen to work with the piezo buzzer on the RFIDuino. Some frequencies may work better than others.

Next: Read Ranges

Feedback Form