#include <Arduino.h>
#include <MFRC522v2.h>
#include <MFRC522DriverSPI.h>
#include <MFRC522DriverPinSimple.h>
#include <MFRC522Debug.h>
#include <MFRC522Hack.h>
// SPI名 MOSI MISO SCLK SS(CS/SDA) QUADWP QUADHD RST
// VSPI 23 19 18 5 22 21
// HSPI 13 12 14 15 2 4
//ESP32-S3
//WROM1 11 13 12 10 14 9 S8
//https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32s3/api-reference/peripherals/spi_master.html
MFRC522DriverPinSimple ss_1_pin(10); // Configurable, take a unused pin, only HIGH/LOW required, must be different to SS 2.
MFRC522DriverSPI driver_1{ss_1_pin};
MFRC522 readers[]{driver_1}; // Create MFRC522 instance.
/**
* Helper routine to dump a byte array as hex values to Serial.
*/
void dump_byte_array(byte *buffer, byte bufferSize) {
for (byte i = 0; i < bufferSize; i++) {
Serial.print(buffer[i] < 0x10 ? &
ESP32-S3-WROOM-1 MFRC522 IC卡操作实例
最新推荐文章于 2025-03-02 16:43:23 发布