Hi, i'm trying to convert a uint8 to a string but can't figure out how to do it.
I want the ID of an RFID card read in to a variable and stored as a string. I can read in the ID of the card as 0x01 0x02 0x03 0x04 0x05 0x06 0x07 but want to record this to a csv file in the format 01020304050607.
I've copied in some code below that i've got working up to this point...
uint8_t success;
uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; // Buffer to store the returned UID
uint8_t uidLength; // Length of the UID (4 or 7 bytes depending on ISO14443A card type)
Serial.println("1.2");
// Wait for an ISO14443A type cards (Mifare, etc.). When one is found
// 'uid' will be populated with the UID, and uidLength will indicate
// if the uid is 4 bytes (Mifare Classic) or 7 bytes (Mifare Ultralight)
success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, &uidLength);
Serial.println("1.3");
if (success) {
// Display some basic information about the card
Serial.println("Found an ISO14443A card");
Serial.print(" UID Length: ");Serial.print(uidLength, DEC);Serial.println(" bytes");
Serial.print(" UID Value: ");
nfc.PrintHex(uid, uidLength);
Serial.println("");
IPAddress destinationIP(192, 168, 10, 1); // Address of target machine
unsigned int destinationPort = 6000; // Port to send to
char rfiduid = uid;
// send a message to Processing, to the IP address and port that sent us the packet we received
Udp.beginPacket(destinationIP,destinationPort);
Udp.write(rfiduid);
Udp.endPacket();
Where I declare the char rfiduid is where I expect the conversion to happen, just not sure how to actually convert it!