NFC NfcAdapter.h problem

Hi folks

Apologies, I'm copying things by hand AND I'm new. I have the Arduino set up on a Window XP system, since the Linux 64 bit was somewhat problematic and I'm hurrying. I have modified the Seeedstudio example as instructed:

#include <SPI.h>
#include <PN532_SPI.h>
#include <PN532.h>
#include <NfcAdapter.h>

PN532_SPI pn532spi(SPI, 10);
NfcAdapter nfc = NfcAdapter(pn532spi);


void setup(void) {
    Serial.begin(9600);
    Serial.println("NDEF Reader");
    nfc.begin();
}

void loop(void) {
    Serial.println("\nScan a NFC tag\n");
    if (nfc.tagPresent())
    {
        NfcTag tag = nfc.read();
        tag.print();
    }
    delay(5000);
}

It's [apparently, see below] picking up the libraries which are in subfolders, but I'm getting:

..Documents\Arduino\libraries\NDEF/NfcAdapter.h:25 error: expected ')' before '&' token:

which is:

NfcAdapter(PN532Interface &interface) ;

I'm not a C++ guy and barely an Arduino guy, so this could be something pretty stupid! TIA Hugh

You are using a bunch of non-standard libraries. If you expect help with them, you need to post links to them.

The compiler is telling you that it does not know what a PN532Interface is. There is nothing included in the sketch that suggests that it should know what a PN532Interface is.

You may be missing an include file in the sketch, since libraries are not allowed to hide the fact that they use other libraries.

If the compiler should know what a PN532Interface is because it is defined in a file you do include, I'd question the whole library, since that would mean that a class is defined in a file with a different name, in violation of all conventions.

Hi Paul,

Thanks, for suggesting this. Actually there seems to be some variations in the download for these libraries from GitHub - Seeed-Studio/PN532: NFC library using PN532 to read/write card and communicate with android.

I've cleared out my last set of library downloads, followed the link in the README rather than the wiki and reorganised the unpacked libraries. Now the sketch compiles, we'll see whether it works later.

For anyone else, I have:

...\libraries\NDEF folder
               \PN532 folder
               \PN532_SPI folder
                \PN532_HSU folder

To some extent this was deduction from the link instructions for Linux too.

I'll mark the original as solved if I can get the NFC tags to read. Thanks again Hugh