Steve,
My apologies... Use the following sketch to send the data back to JMRI over the serial connection you create above.?
?
#include <SPI.h>
#include <MFRC522.h>
?
#define SS_PIN 10
#define RST_PIN 9
?
MFRC522 rfid(SS_PIN, RST_PIN); // Instance of the class
?
MFRC522::MIFARE_Key key;?
?
// Init array that will store new NUID?
byte nuidPICC[4];
?
void setup() {?
? Serial.begin(9600, SERIAL_8N1);
? SPI.begin(); // Init SPI bus
? rfid.PCD_Init(); // Init MFRC522?
?
? for (byte i = 0; i < 6; i++) {
? ? key.keyByte[i] = 0xFF;
? }
?
?
}
?
void loop() {
? // Look for new cards
? if ( ! rfid.PICC_IsNewCardPresent())
? ? return;
?
? // Verify if the NUID has been read
? if ( ! rfid.PICC_ReadCardSerial())
? ? return;
?
? // Format the RFID data as a string
? String rfidString = "";
? for (byte i = 0; i < 4; i++) {
? ? rfidString += String(rfid.uid.uidByte[i], HEX);
? }
?
? // Send the RFID data as a string over the serial port
? Serial.println(rfidString);
?
? rfid.PICC_HaltA();
? rfid.PCD_StopCrypto1();
}