繁体   English   中英

Arduino Uno和NFC屏蔽

[英]Arduino Uno & NFC Shield

我正在尝试在NFC防护罩和arduino uno之间建立连接。 我正在使用seeedstudio nfc shield v2.0。

我已经上传了所有必需的库。 但是,当我尝试这个代码片段时;

#include <SPI.h>
#include "PN532_SPI.h"
#include "PN532.h"
#include "NfcAdapter.h"

PN532_SPI interface(SPI, 10); // create a PN532 SPI interface with the SPI CS terminal located at digital pin 10
NfcAdapter nfc = NfcAdapter(interface); // create an NFC adapter object

void setup(void) {
    Serial.begin(115200); // begin serial communication
    Serial.println("NDEF Reader");
    nfc.begin(); // begin NFC communication
}

void loop(void) {

Serial.println("\nScan an NFC tag\n");

if (nfc.tagPresent()) // Do an NFC scan to see if an NFC tag is present
{
    NfcTag tag = nfc.read(); // read the NFC tag into an object, nfc.read() returns an NfcTag object.
    tag.print(); // prints the NFC tags type, UID, and NDEF message (if available)
}
   delay(500); // wait half a second (500ms) before scanning again (you may increment or decrement the wait time)
}

我收到一条错误消息:

NDEF Reader找不到PN53x板

有人对我的问题有任何想法吗? 我该怎么办?

谢谢

PN53x板是NFC读取器,其他NFC读取器(例如电话)无法读取。 NFC有两种模式:读取器和标签。 标签可以由阅读器读取。

因此,使用PN53x板读取nfc标签。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM