How to print byte as string?


I save some values in EEPROM, so I save them as byte.

When I want to print these values I somehow need to convert the to a string…

Is there a function to do this?

Read the examples at There are different options to print a byte

I forgot to say, I'm using a LCD to print those values...

I found a solution:


p1 is the byte variable... there may be a better way, but this works for now...

I do not know the dtostrf() call, what are the other parameters? If I want to print a byte I use something like

byte b = 234;
char s[4];
snprintf(s, 4, "%d", b);
Serial.println(s);   // or LCD.print(s);

Notwithstanding the other advice, perhaps you should post the code that saves the "bytes" to EEPROM, and the code the reads the "bytes" from EEPROM, and explain exactly what those "bytes" correspond to. How to convert bytes that comprise a float to a string will be completely different from how to convert the bytes that represent characters (which need no conversion).