Hey all, been getting this error here and I can't seem to find the answer for it. I'm using the same code from the example and it doesn't give any errors. Does it have something to do with my libraries?
Thanks
The Error
Learning_PN532:9: error: expected unqualified-id before numeric constant
Learning_PN532.ino: In function 'void loop()':
Learning_PN532:19: error: no matching function for call to 'Adafruit_NFCShield_I2C::readPassiveTargetID(int, uint8_t*)'
F:\Arduino-1.0.5-r2\libraries\AdafruitNFCShieldI2Cmaster/Adafruit_NFCShield_I2C.h:172: note: candidates are: boolean Adafruit_NFCShield_I2C::readPassiveTargetID(uint8_t, uint8_t*, uint8_t*)
Learning_PN532:20: error: invalid conversion from 'byte' to 'const void*'
Learning_PN532:20: error: initializing argument 2 of 'int memcmp(const void*, const void*, size_t)'
The Code
#include <Wire.h>
#include <Adafruit_NFCShield_I2C.h>
#define IRQ (2)
#define RESET (3)
Adafruit_NFCShield_I2C nfc(IRQ, RESET);
int greenLED=8;
int redLED=9;
byte goodCard=0x64,0x40,0xB1,0x76;
void setup(){
nfc.begin();
pinMode(greenLED,OUTPUT);
pinMode(redLED,OUTPUT);
}
void loop(){
boolean success;
uint8_t uid[] = {0,0,0,0,0,0,0};
success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0]);
if(memcmp(uid, goodCard, sizeof(goodCard))){
digitalWrite(greenLED,HIGH);
delay(1000);
digitalWrite(greenLED,LOW);
}
else{
digitalWrite(redLED,HIGH);
delay(1000);
digitalWrite(redLED,LOW);
}
}