Hi guys,
I'm playing with the WriteTag example sketch for this device (library is also in the link)
https://dangerousthings.com/wp-content/uploads/2013/12/PN532_-Manual_V3.pdf
I tried bringing the entire sketch to its own void function and simply looping that function but I'm getting an error message.
#if 0
#include <SPI.h>
#include <PN532_SPI.h>
#include <PN532.h>
#include <NfcAdapter.h>
PN532_SPI pn532spi(SPI, 10);
NfcAdapter nfc = NfcAdapter(pn532spi);
#else
#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
#include <NfcAdapter.h>
PN532_I2C pn532_i2c(Wire);
NfcAdapter nfc = NfcAdapter(pn532_i2c);
#endif
#include <SoftwareSerial.h>
int i = 0;
int incomingByte;
int convertedIncoming;
int bar[20];
void setup() {
Serial.begin(9600);
Serial.println("Barcode Tag Associator");
nfc.begin();
}
void loop() {
process();
}
void process(){
Serial.println("\nPlace a formatted Mifare Classic NFC tag on the reader.");
if (nfc.tagPresent()) {
NdefMessage message = NdefMessage();
message.addUriRecord("http://arduino.cc");
bool success = nfc.write(message);
if (success) {
Serial.println("Success. Try reading this tag with your phone.");
} else {
Serial.println("Write failed.");
}
}
delay(5000);
}
WriteTag.ino: In function 'void loop()':
WriteTag:41: error: 'process' was not declared in this scope
'process' was not declared in this scope