I am trying connect my ESP8266 ESP-12E CH340G NodeMCU V3 with PN532 NFC chip.
But NodeMCU can't find my NFC Chip.
nfc.getFirmwareVersion() is always 0
Here is my code (Using newest libraries from github):
#if 1
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <PN532_SPI.h>
#include <NfcAdapter.h>
#include <PN532.h>
PN532_SPI pn532spi(SPI, 15);
PN532 nfc(pn532spi);
#elif 0
#include <PN532_HSU.h>
#include <PN532.h>
PN532_HSU pn532hsu(Serial1);
PN532 nfc(pn532hsu);
else
#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
#include <NfcAdapter.h>
PN532_I2C pn532i2c(Wire);
PN532 nfc(pn532spi);
#endif
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("NDEF Reader");
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("\nScan a NFC tag\n");
nfc.begin();
uint32_t versiondata = nfc.getFirmwareVersion();
Serial.print(versiondata);
if (! versiondata)
{
Serial.print("Didn't find");
while(1);
}
delay(5000);
}
Here is my connection:
I have also tried connect SS to D4 but same result.
Thanks everyone for your help !