This library is for the PN532 chip to use NFC technology.
This is a fork of the PN532 library by Seeed-Studio.
It provides a small bit a configuration code and small changes to be able to use its components as libraries in PlatformIO.
-
Add both the core library and communication adapter to the
platformio.ini
filelib_deps = ; ... PN532=https://github.com/gusaln/PN532/releases/download/1.0.0/PN532.tar.gz PN532_SPI=https://github.com/gusaln/PN532/releases/download/1.0.0/PN532_SPI.tar.gz
-
We need to include the these dependencies in a header file and not in a
.cpp
file. This can be done in an existing.h
file in your project or you can create one at either thesrc
directory or theinclude
directory. For example, say we create aninclude/NFC.h
file#include <NfcAdapter.h> #include <PN532.h> #include <PN532_SPI.h>
and then include it into our
main.cpp
file#include "NFC.h"
This is required in order to allow the Library Dependency Finder (LDF) of PlatformIO to include them correctly during compilation. Including the PN532* dependencies directly into a
.cpp
will cause errors. For more information, read the PlatformIO docs on the matter.