A simple library to interface with Gwiot 7941E RFID reader. Based on rdm6300 library by Arad Eizen.
A simple RFID tag reader with textual Serial output:
examples/read_to_serial/read_to_serial.ino
#include <Gwiot7941e.h>
#define GWIOT_7941E_RX_PIN 4
Gwiot7941e gwiot7941e;
void setup()
{
//...
gwiot7941e.begin(GWIOT_7941E_RX_PIN);
//...
}
void loop()
{
//...
if (gwiot7941e.update()) {
Serial.println(gwiot7941e.getLastTagId(), HEX);
}
//...
}
void begin(Stream *stream)
- Initialize the object to use the given Stream
(i.e. an AltSoftSerial
object) to read from the 7941E.void begin(int rxPin, uint8_t uartNum=1)
- Initialize the object to use the
given GPIO pin as RX from the 7941E. Use uartNum
to specify which Serial to
use on ESP8266/ESP32.bool update()
- Updates the internal values by reading from the 7941E, returns
true
on tag detection, must be called repeatedly!uint32_t getLastTagId()
- Returns the last tag id read by update()
.Here are some additional resources about the Gwiot 7941E RFID reader.