ESP32-S3-WROOM-1 MFRC522 IC卡操作实例

#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 ? &
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值