### Example 1 - Constant Read Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md This example demonstrates how to configure the M7E RFID reader to continuously scan for and report RFID tags. It includes setup for serial communication, baud rate, and module type, then initiates scanning and prints tag EPCs to the serial monitor. ```Arduino C++ --8<-- "https://raw.githubusercontent.com/sparkfun/SparkFun_Simultaneous_RFID_Tag_Reader_Library/master/examples/Example1_Constant_Read/Example1_Constant_Read.ino" ``` -------------------------------- ### Example 2 - Read EPC Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md This example shows how to perform a single-shot read of an RFID tag. It utilizes the `.readTagEPC()` function to scan for a tag within a specified timeout and retrieve its EPC (Electronic Product Code). It also includes optional code for buzzer feedback. ```Arduino C++ --8<-- "https://raw.githubusercontent.com/sparkfun/SparkFun_Simultaneous_RFID_Tag_Reader_Library/master/examples/Example2_Read_EPC/Example2_Read_EPC.ino" ``` -------------------------------- ### Write RFID Tag Passwords (Arduino C++) Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md This example shows how to write new Access and Kill passwords to an RFID tag. You can adjust the default passwords by modifying the `myKillPW` and `myAccessPW` byte arrays. A non-zero kill password is required for the kill command to function. ```Arduino C++ --8<-- "https://raw.githubusercontent.com/sparkfun/SparkFun_Simultaneous_RFID_Tag_Reader_Library/master/examples/Example7_Write_Passwords/Example7_Write_Passwords.ino" byte myKillPW[] = {0xEE, 0xFF, 0x11, 0x22}; byte myAccessPW[] = {0x12, 0x34, 0x56, 0x78}; ``` -------------------------------- ### Read RFID Tag Passwords (Arduino C++) Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md This example demonstrates how to read the Access and Kill passwords of an RFID tag detected by the reader. The Access password controls memory modifications, while the Kill password is required to disable the tag. Default passwords are 0x00000000. ```Arduino C++ --8<-- "https://raw.githubusercontent.com/sparkfun/SparkFun_Simultaneous_RFID_Tag_Reader_Library/master/examples/Example6_Read_Passwords/Example6_Read_Passwords.ino" ``` -------------------------------- ### Select RFID Serial Port Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md Configures which serial port the RFID reader library will use for communication. Users can choose between SoftwareSerial (defined as 'softSerial') or a hardware serial port (e.g., 'Serial1') based on their development board's capabilities and setup. ```Arduino C++ // #define rfidSerial softSerial // Software serial (eg. Arudino Uno or SparkFun RedBoard) #define rfidSerial Serial1 // Hardware serial (eg. ESP32 or Teensy) ``` -------------------------------- ### Kill RFID Tag (Arduino C++) Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md This example demonstrates how to irreversibly disable (kill) an RFID tag. Killing a tag permanently disables its functionality by blowing an internal fuse. This process requires a previously set non-zero Kill Password. ```Arduino C++ --8<-- "https://raw.githubusercontent.com/sparkfun/SparkFun_Simultaneous_RFID_Tag_Reader_Library/master/examples/Example8_Kill_Tag/Example8_Kill_Tag.ino" ``` -------------------------------- ### Jinja Templating Directives Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/overrides/partials/tabs.html Demonstrates common Jinja templating directives used for conditional logic, imports, and loops within documentation generation. ```jinja {% import "partials/tabs-item.html" as item with context %} ``` ```jinja {% if "hard_copy.md" %} * [Print View 🖨️](/SparkFun_Simultaneous_RFID_Reader_M7E/hard_copy/) {% endif %} ``` ```jinja {% for nav_item in nav %} {{ item.render(nav_item) }} {% endfor %} ``` -------------------------------- ### Select RFID Module Type Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md Specifies which SparkFun Simultaneous RFID Reader module is being used, supporting both the M6E Nano and M7E Hecto. This definition ensures the library correctly interfaces with the hardware. ```Arduino C++ // #define moduleType ThingMagic_M6E_NANO #define moduleType ThingMagic_M7E_HECTO ``` -------------------------------- ### Configure Software Serial Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md Defines pins for SoftwareSerial communication, allowing the RFID reader to communicate with development boards that may not have multiple hardware serial ports. This is crucial for flexibility in connecting the reader. ```Arduino C++ #include SoftwareSerial softSerial(2, 3); //RX, TX ``` -------------------------------- ### Configure RFID Baud Rate Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md Sets the baud rate for communication with the RFID reader module. The recommended baud rate depends on whether hardware or software serial is used, with 38400 for software serial and 115200 for hardware serial. ```Arduino C++ // #define rfidBaud 38400 #define rfidBaud 115200 ``` -------------------------------- ### Write User Data to RFID Tag Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md Demonstrates writing custom data to a tag's user memory. The data must be an even number of bytes. This function writes to the first tag detected by the reader. ```arduino char testData[] = "ACBD"; //Must be even number of bytes. "Hello" is recorded as "Hell". byte responseType = nano.writeUserData(testData, sizeof(testData) - 1); //The -1 shaves off the \0 found at the end of string ``` -------------------------------- ### Read RFID Tag User Data Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md Shows how to detect and read available user memory on an RFID tag. Note that not all UHF RFID tags have user memory or are configurable. ```arduino // Code for reading user data would be placed here, referencing the nano object. ``` -------------------------------- ### RFID Reader API - readTagEPC Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md Reads a single RFID tag's EPC (Electronic Product Code). This function attempts to scan for a tag and stores the EPC in a provided byte array. It returns a status code indicating success or failure. ```APIDOC RFIDReader::readTagEPC(byte* epcBuffer, size_t bufferSize, uint32_t timeoutMs) - Reads a single RFID tag's EPC. - Parameters: - epcBuffer: A byte array to store the read EPC. - bufferSize: The maximum size of the epcBuffer. - timeoutMs: The maximum time (in milliseconds) to wait for a tag. - Returns: - RESPONSE_SUCCESS: If a tag was successfully read and its EPC stored. - Other error codes: If the read operation failed (e.g., timeout, no tag found). - Example: byte epc[12]; if (reader.readTagEPC(epc, 12, 500) == RESPONSE_SUCCESS) { // Process the EPC data in the 'epc' array } ``` -------------------------------- ### Set RFID Write Power Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md Explains how to set the power level for writing operations to an RFID tag. Higher values may cause USB port brownouts, and maximum TX power can lead to thermal throttling. ```arduino nano.setWritePower(500); //5.00 dBm. Higher values may cause USB port to brown out //Max Write TX Power is 27.00 dBm and may cause temperature-limit throttling ``` -------------------------------- ### Write EPC to RFID Tag Source: https://github.com/sparkfun/sparkfun_simultaneous_rfid_reader_m7e/blob/main/docs/examples.md Demonstrates writing a custom EPC value to an RFID tag. EPCs must be an even number of bytes. This function is part of the RFID reader library. ```arduino char stringEPC[] = "Hello!"; //You can only write even number of bytes byte responseType = nano.writeTagEPC(stringEPC, sizeof(stringEPC) - 1); //The -1 shaves off the \0 found at the end of string ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.