Skip to content

4. Arduino Examples

Jaz edited this page Oct 17, 2022 · 8 revisions

Library Installation

Download the Adafruit PN532 version 1.0.4 library from Arduino Library Manager.

ATTENTION: Currently this board and version of Arduino Core only stable works with the version Adafruit PN532 1.0.4

Arduino Examples

If you're using the NFC breakout with an SPI connection that uses the wiring shown on previous pages you can immediately upload the sketch to the Arduino and skip down to the Testing MiFare section.

Once you have installed the Arduino core, you have available examples by Salvador Mendoza and that he explains in his blog.

All examples are found in this repository in the folder Examples

For all the examples you must have in your sketch the following configuration

If using the breakout with SPI, define the pins for SPI communication.

#define PN532_SCK (17)

#define PN532_MOSI (16)

#define PN532_SS (18)

#define PN532_MISO (19)

For Magpoof coil

#define L1 (14) //LED1

#define L2 (5) //LED2

#define L3 (4) //LED3

For Buttons

#define MPIN (28) //MagsSpoof Button

#define NPIN (27) //NFC Button

Example List:

  • MagSpoof: This example demonstrates how to use NFC Copy Cat as Magspoof magnetic stripe
  • NFCopy-CheckPDOL: Example to read a Visa NFC card
  • NFCopy-MSD: Example to replay a Visa MSD transaction by NFC using a static value.
  • NFCopy-ReadCard: Example to read a Visa NFC card
  • Read_replay_spoof: Example to extract track 2 from an NFC transaction and emulate a Visa MSD transaction or spoof magnetic data with MagSpoof
  • iso14443a_uid: This example will attempt to connect to an ISO14443A card or tag and retrieve some basic information about it that can be used to determine what type of card it is.
  • readMifare: This example will wait for any ISO14443A card or tag, and depending on the size of the UID will attempt to read from it.
Clone this wiki locally