I'm using an RC522 RFID reader with an Arduino UNO. There is a function?? (or whatever it's called :)) in Miguel Balboa's new MFRC522.h library which is mfrc522.uid.uidByte[i] that prints the bytes of the unique ID. The repetition of the function results in 8 piece of HEX digits that are from the 2 numbers that each function outputs (2+2+2+2=8). Whenever I use the line of codes that are commented out, the serial monitor outputs them successfully. So for example, 12345678 is the unique id, each array displayed 12, then 34, then, 56, then 78 which is 12345678 in the serial. which is fast and unnoticeable besides that there are no spaces included when on output. The thing is, I want to output all of these into a single variable.(Please help me also on how to concatenate) How can I do this? An attempt was done below (not commented out) but it outputs only the number 16, consistently, which is I think due to a data type problem. The variables are initialized as int. The "function" which I found in the library is initialized as byte (correct me If I'm wrong). But when the variables are initialized as byte, I cannot upload the sketch since there are errors. Please help. :( (The reason I need it to be saved into a single variable is because I am placing it in the GET method of an Ethernet Client. I don't think the bare function can do that. (Or if it can, can you please help with the code? :)) Thanks
// Dump UID
//Serial.print("Card UID:");
//Serial.print(mfrc522.uid.uidByte[0], HEX);
//Serial.print(mfrc522.uid.uidByte[1], HEX);
//Serial.print(mfrc522.uid.uidByte[2], HEX);
//Serial.print(mfrc522.uid.uidByte[3], HEX);
serNum0={mfrc522.uid.uidByte[0], HEX};
serNum1={mfrc522.uid.uidByte[1], HEX};
serNum2={mfrc522.uid.uidByte[2], HEX};
serNum3={mfrc522.uid.uidByte[3], HEX};
Serial.print(serNum0);
Serial.print(serNum1);
Serial.print(serNum2);
Serial.print(serNum3);