Hi all,
I'm struggling to get a particular aspect of my program to work. Basically I want to print the entire array to a mysql database.
From what I can figure out it's only printing the single part of the array as it's in a loop. How do I print the entire array?
This is used in an RFID build and i'm trying to print the tag EPC to a sql database.
Devices used:
Arduino Uno WiFI Rev 2
Sparkfun Simultaneous RFID Reader
Code Below:
// Data Reading Below
void loop()
{
Serial.read(); //Throw away the user's character
byte myEPC[12]; //Most EPCs are 12 bytes
byte myEPClength;
byte responseType = 0;
byte data;
while (responseType != RESPONSE_SUCCESS)//RESPONSE_IS_TAGFOUND)
{
myEPClength = sizeof(myEPC); //Length of EPC is modified each time .readTagEPC is called
responseType = nano.readTagEPC(myEPC, myEPClength, 500); //Scan for a new tag up to 500ms. NEEDED?
Serial.println(F("Searching for tag"));
}
Serial.print ("EPC= ");
for (byte x = 0 ; x < myEPClength ; x++)
{
if (myEPC[x] < 0x10) Serial.print(F("0"));
Serial.print(myEPC[x], HEX);
Serial.print(F(" "));
//need to figure this out!!
data = (myEPC[x], HEX);
}
Serial.println(data);
Serial.println(F(""));
Serial.print("DeviceID= ");
Serial.println (reader);
//connect to server
if (client.connect(server, 80)){
client.print("GET /add_data.php?");
client.print("value=");
client.print(data);
client.print("&location=");
client.print(reader);
client.println(" HTTP/1.1");
client.print("Host: ");
client.println(server);
client.println("Connection: close");
client.println();
client.println();
client.stop();
I'm very new to this so any help would be greatly appreciated.