Hi - I have bought NFC Shield V2.0 and followed the instructions as in Wiki – but not able to get it working. I have an urgent project that relies on reading/writing NFC. Would really appreciate your helps on making this works.
Compile Error: ‘Serial1’ was not declared in this scope
I am not sure I have structured the library correctly. The instruction on Wiki is not that clear, and could use your guidance on more detailed instruction to ensure I get it right.
Multiple libraries were found for “NfcAdapter.h”
Used: C:\Users\defaultuser0.LAPTOP-A61P8187\Documents\Arduino\libraries\Seeed_Arduino_NFC-master
Not used: C:\Program Files (x86)\Arduino\libraries\Seeed_Arduino_NFC-master
exit status 1
‘Serial1’ was not declared in this scope
ReadTag:2:10: fatal error: Seeed_Arduino_NFC.h: No such file or directory
#include <Seeed_Arduino_NFC.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Seeed_Arduino_NFC.h: No such file or directory
Here is the test code provided in that topic.
#include <SPI.h>
#include <Seeed_Arduino_NFC.h>
#include <NfcAdapter.h>
PN532_SPI pn532spi(SPI, 10);
NfcAdapter nfc = NfcAdapter(pn532spi);
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)
}