I am receiving bytes, converting them into hex and now I need to convert the hex to ASCII. Can it be done on an Arduino? Or do I need something else? I am new to programming with Arduino.
If you have a byte variable
b, you can
write(b)it as it is. if it is ASCII code of a readable character, the Serial Monitor will display it as that character, for example for 65 it will printt 'A'
- print it as decimal number with
print(b). for 65 it will print "65"
- print it as hexadecimal number with
print(b, HEX). for 65 it will print "41"
- print it as a number in other base with
print(b, base), for example
print(b, 2)will print 1000001 if b is 65 in decimal