I try to use code:
Code: Select all
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_PN532.h>
#define PN532_SCK (2)
#define PN532_MISO (15)
#define PN532_MOSI (13)
#define PN532_SS (37)
Adafruit_PN532 nfc(PN532_SCK, PN532_MISO, PN532_MOSI, PN532_SS);
void setup(void) {
Serial.begin(115200);
nfc.begin();
uint32_t versiondata = nfc.getFirmwareVersion();
if (! versiondata) {
Serial.print("Didn't find PN53x board");
while (1); // halt
}
// Got ok data, print it out!
Serial.print("Found chip PN5"); Serial.println((versiondata>>24) & 0xFF, HEX);
Serial.print("Firmware ver. "); Serial.print((versiondata>>16) & 0xFF, DEC);
Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);
// configure board to read RFID tags
nfc.SAMConfig();
}
Code: Select all
Adafruit_PN532::Adafruit_PN532(uint8_t clk, uint8_t miso, uint8_t mosi,
uint8_t ss) {
spi_dev = new Adafruit_SPIDevice(ss, clk, miso, mosi, 100000,
SPI_BITORDER_LSBFIRST, SPI_MODE0);
}
Adafruit_PN532::Adafruit_PN532(uint8_t ss) {
spi_dev =
new Adafruit_SPIDevice(ss, 100000, SPI_BITORDER_LSBFIRST, SPI_MODE0);
}
Any one can help me, what is problem and how to fix it? Thanks!