i am using an Arduino UNO as a slave. up until now i have managed to sent and receive numbers from one to the other using this schematic and programming to both: http://blog.oscarliang.net/raspberry-pi ... ected-i2c/ .
On my Arduino i am using an NFC reader and i want to sent the card's UID to my raspberry pi. i have tried lots of methods that i have found but non of them seems to be working for me. this has become frustrating. i just want to get a UID and sent it over to my raspberry pi. could you please help me with this problem?
The code for receiving the UID is:
Code: Select all
{
NFCserial.listen();
while (NFCserial.available() > 0) {
boolean success;
// Buffer to store the returned UID
uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };
uint8_t uidLength; // Length of the UID
// Wait for an ISO14443A type cards (Mifare, etc.).
// When one is found'uid' will be populated with the UID
success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength);
if (success) {
Serial.println("");
Serial.print("UID Value: ");
for (uint8_t i=0; i < uidLength; i++)
{
Serial.print(uid[i], HEX);
}
Serial.println("");
delay(10000); // Try to read a card every 10 sec
}
}