Arduino Hangs NFC Shield

Status
Not open for further replies.

paintlax

Newbie level 3
Joined
May 20, 2014
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
25
I am using the NFC shield found here (https://www.seeedstudio.com/depot/NFC-Shield-V20-p-1370.html?cPath=19_24) and using the example code below. In the serial monitor "NDEF READER" prints but then the arduino hangs and does print anything else...any suggestions?

Code:
#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

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(1000);
}
 


If the Arduino NFC Shield red light is not on, the board is "hung" and you need to clear the arduino sketch and reboot to bring it back
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…