Answer the question
In order to leave comments, you need to log in
How to interact with RFID on TX and RX?
RFID 7941W came.
When connected to the Arduino, it shows signs of life, but refuses to accept commands.
#include <SoftwareSerial.h>
SoftwareSerial rfidSerial(1, 0); // RX, TX
byte read_UID[6] = {0xAB, 0xBA, 0x00, 0x10, 0x00, 0x10};
byte read_PID[6] = {0xAB, 0xBA, 0x00, 0x15, 0x00, 0x15};
int read_UID_size = sizeof(read_UID) - 1;
int read_PID_size = sizeof(read_PID) - 1;
void setup()
{
Serial.begin(115200);
Serial.println("Goodnight moon!");
rfidSerial.begin(115200);
}
void loop()
{
if (read_PID_size != 0) {
for (read_PID_size; read_PID_size >= 0; read_PID_size--) {
rfidSerial.write(read_PID[read_PID_size]);
}
}
Serial.println("[|||||||||||||||||||||||||||||||]");
if (read_UID_size != 0) {
for (read_UID_size; read_UID_size >= 0; read_UID_size--) {
rfidSerial.write(read_UID[read_UID_size]);
}
}
read_UID_size = sizeof(read_UID) - 1;
read_PID_size = sizeof(read_PID) - 1;
delay(500);
}
if (Serial.available() > 0) {
Serial.println(Serial.read(), DEC);
}
Answer the question
In order to leave comments, you need to log in
Find the documentation for the device and read how to work with it there.
In the sketch and in addition to direct work with the device, nonsense is written. You have SoftwareSerial on the same pins where the Arduino has a hardware serial. Do you really expect this to work? Next, for SoftwareSerial 115200 a lot. Formally supported, but rarely works in reality. And are you sure that this device works at this speed?
Good day, in order to communicate with this module, you need to send certain messages to it, which are described in the technical documentation:
At the moment I am writing a desktop program for this module, I can share the beta version if interested.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question