I have an issue with this library error which I have been trying to resolve for 1 hour. I downloaded my libraries in these sites: GitHub - Seeed-Studio/PN532: NFC library using PN532 to read/write card and communicate with android and GitHub - don/NDEF: NDEF Library for Arduino. Read and Write NDEF Messages to NFC tags with Arduino.. I download both files and placed it in C:/Program Files(x86)/Arduino/Libraries.
This is the error message:
Arduino: 1.6.6 (Windows 8.1), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
D:\My Folder\School Files\Research\final\final.ino:3:19: fatal error: PN532.h: No such file or directory
#include <PN532.h>
^
compilation terminated.
exit status 1
Error compiling.
Edited: I found another thing in the error message when I tried to manage my libraries.
"Invalid library found in C:\Program Files (x86)\Arduino\libraries\PN532: C:\Program Files (x86)\Arduino\libraries\PN532"
My code is this:
#include <SD.h>
#include <SPI.h>
#include <PN532.h>
#include <PN532_SPI.h>
#include <NfcAdapter.h>
PN532_SPI pn532spi(SPI, 10);
NfcAdapter nfc = NfcAdapter(pn532spi);
File file;
File sdFile;
SdFile root;
void setup() {
Serial.begin(9600);
while(!Serial){
}
nfc.begin();
if(!SD.begin(52)){
Serial.println("SD Card not found...");
Serial.println("Closing the program.");
return;
}
else{
Serial.println("SD Card Found...");
Serial.println("The program is ready, please give an input...");
}
}
void loop() {
if(nfc.tagPresent()){
NfcTag tag = nfc.read();
tag.print();
file = tag;
if(file == tag){
Serial.println("Transfering file...");
if(SD.exists(file)){
Serial.println("The document is already present, please select another document...");
}
else{
sdFile = SD.open(file, FILE_WRITE);
if(SD.exists(file)){
Serial.println("File transfer comeplete.");
}
Serial.println("All files present: ");
root.openRoot(512);
root.ls(LS_R | LS_DATE | LS_SIZE);
sdFile.close();
}
}
}
else{
Serial.println("Waiting for input...");
}
delay(100);
}
Please do not mind if there are other errors in this program because I haven't tested it yet (of course!).
Moderator: added code tags