第一篇:RFID的使用与说明-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 3233|回复: 10

[Arduino教程] 第一篇:RFID的使用与说明

[复制链接]
发表于 2022-2-24 19:46 | 显示全部楼层 |阅读模式
新手教程:适用于arduino UNO
感谢支持
接线图.jpg

代码文件IDE.zip

40.9 KB, 下载次数: 31

RC522-datasheet.pdf

526.2 KB, 下载次数: 32

RFID模块说明书

 楼主| 发表于 2022-2-25 14:18 | 显示全部楼层
感谢支持
持续更新中
楼主24小时内可快速回复
 楼主| 发表于 2022-2-28 14:50 | 显示全部楼层
欢迎提意见
 楼主| 发表于 2022-3-11 14:31 | 显示全部楼层
一个人也没有吗
大家都不喜欢我了吗
 楼主| 发表于 2022-5-7 21:10 | 显示全部楼层

感谢支持
发表于 2022-8-6 22:27 | 显示全部楼层
下载来学学习学习 最近在接触rfid
发表于 2022-8-24 19:55 | 显示全部楼层
大佬,报错了
发表于 2022-8-24 19:56 | 显示全部楼层
Arduino:1.7.8 (Windows 8.1), 板:"Arduino Uno"

In file included from MFRC522.h:78:0,

                 from MFRC522.cpp:8:

require_cpp11.h:9:2: error: #error "This library needs at least a C++11 compliant compiler, maybe compiler argument for C++11 support is missing or if you use Arduino IDE upgrade to version >=1.6.6"

#error "This library needs at least a C++11 compliant compiler, maybe compiler argument for C++11 support is missing or if you use Arduino IDE upgrade to version >=1.6.6"

  ^

In file included from MFRC522.cpp:8:0:

MFRC522.h:146:9: error: 'constexpr' does not name a type

  static constexpr byte FIFO_SIZE = 64;  // The FIFO is 64 bytes.

         ^

MFRC522.h:146:9: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11

MFRC522.h:148:9: error: 'constexpr' does not name a type

  static constexpr uint8_t UNUSED_PIN = UINT8_MAX;

         ^

MFRC522.h:148:9: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11

In file included from MFRC522.cpp:8:0:

MFRC522.h:376:111: error: 'nullptr' was not declared in this scope

  StatusCode PCD_TransceiveData(byte *sendData, byte sendLen, byte *backData, byte *backLen, byte *validBits = nullptr, byte rxAlign = 0, bool checkCRC = false);

                                                                                                               ^

MFRC522.h:377:112: error: 'nullptr' was not declared in this scope

  StatusCode PCD_CommunicateWithPICC(byte command, byte waitIRq, byte *sendData, byte sendLen, byte *backData = nullptr, byte *backLen = nullptr, byte *validBits = nullptr, byte rxAlign = 0, bool checkCRC = false);

                                                                                                                ^

MFRC522.h:377:137: error: 'nullptr' was not declared in this scope

  StatusCode PCD_CommunicateWithPICC(byte command, byte waitIRq, byte *sendData, byte sendLen, byte *backData = nullptr, byte *backLen = nullptr, byte *validBits = nullptr, byte rxAlign = 0, bool checkCRC = false);

                                                                                                                                         ^

MFRC522.h:377:164: error: 'nullptr' was not declared in this scope

  StatusCode PCD_CommunicateWithPICC(byte command, byte waitIRq, byte *sendData, byte sendLen, byte *backData = nullptr, byte *backLen = nullptr, byte *validBits = nullptr, byte rxAlign = 0, bool checkCRC = false);

                                                                                                                                                                    ^

MFRC522.cpp: In constructor 'MFRC522::MFRC522()':

MFRC522.cpp:16:33: error: 'UINT8_MAX' was not declared in this scope

MFRC522::MFRC522(): MFRC522(SS, UINT8_MAX) { // SS is defined in pins_arduino.h, UINT8_MAX means there is no connection from Arduino to MFRC522's reset and power down input

                                 ^

MFRC522.cpp: In member function 'void MFRC522:CD_Init()':

MFRC522.cpp:201:28: error: 'UNUSED_PIN' was not declared in this scope

  if (_resetPowerDownPin != UNUSED_PIN) {

                            ^

MFRC522.cpp: In member function 'MFRC522::StatusCode MFRC522:ICC_REQA_or_WUPA(byte, byte*, byte*)':

MFRC522.cpp:587:20: error: 'nullptr' was not declared in this scope

  if (bufferATQA == nullptr || *bufferSize < 2) { // The ATQA response is 2 bytes long.

                    ^

MFRC522.cpp: In member function 'MFRC522::StatusCode MFRC522:ICC_HaltA()':

MFRC522.cpp:854:54: error: 'nullptr' was not declared in this scope

  result = PCD_TransceiveData(buffer, sizeof(buffer), nullptr, 0);

                                                      ^

MFRC522.cpp: In member function 'MFRC522::StatusCode MFRC522:CD_Authenticate(byte, byte, MFRC522::MIFARE_Key*, MFRC522::Uid*)':

MFRC522.cpp:903:87: error: call to 'MFRC522::StatusCode MFRC522:CD_CommunicateWithPICC(byte, byte, byte*, byte, byte*, byte*, byte*, byte, bool)' uses the default argument for parameter 5, which is not yet defined

  return PCD_CommunicateWithPICC(PCD_MFAuthent, waitIRq, &sendData[0], sizeof(sendData));

                                                                                       ^

MFRC522.cpp:903:87: error: call to 'MFRC522::StatusCode MFRC522:CD_CommunicateWithPICC(byte, byte, byte*, byte, byte*, byte*, byte*, byte, bool)' uses the default argument for parameter 6, which is not yet defined

MFRC522.cpp:903:87: error: call to 'MFRC522::StatusCode MFRC522:CD_CommunicateWithPICC(byte, byte, byte*, byte, byte*, byte*, byte*, byte, bool)' uses the default argument for parameter 7, which is not yet defined

MFRC522.cpp: In member function 'MFRC522::StatusCode MFRC522::MIFARE_Read(byte, byte*, byte*)':

MFRC522.cpp:938:16: error: 'nullptr' was not declared in this scope

  if (buffer == nullptr || *bufferSize < 18) {

                ^

MFRC522.cpp:952:59: error: 'nullptr' was not declared in this scope

  return PCD_TransceiveData(buffer, 4, buffer, bufferSize, nullptr, 0, true);

                                                           ^

MFRC522.cpp: In member function 'MFRC522::StatusCode MFRC522::MIFARE_Write(byte, byte*, byte)':

MFRC522.cpp:973:16: error: 'nullptr' was not declared in this scope

  if (buffer == nullptr || bufferSize < 16) {

                ^

MFRC522.cpp: In member function 'MFRC522::StatusCode MFRC522::MIFARE_Ultralight_Write(byte, byte*, byte)':

MFRC522.cpp:1008:16: error: 'nullptr' was not declared in this scope

  if (buffer == nullptr || bufferSize < 4) {

                ^

MFRC522.cpp: In member function 'MFRC522::StatusCode MFRC522:CD_MIFARE_Transceive(byte*, byte, bool)':

MFRC522.cpp:1241:18: error: 'nullptr' was not declared in this scope

  if (sendData == nullptr || sendLen > 16) {

                  ^

编译有误。

  报告将会包含更多的信息
  "在编译时,输出详细信息"
  在 文件>首选项 中启用
 楼主| 发表于 2022-9-13 13:46 | 显示全部楼层
Rakin 发表于 2022-8-24 19:56
Arduino:1.7.8 (Windows 8.1), 板:"Arduino Uno"

In file included from MFRC522.h:78:0,

ok,thankyou
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-12-1 06:59 , Processed in 0.102606 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表