Convert string to hex
-
Hi all..
I am using M5Stack Core 2. Anyone can help me on converting string to hex. I got string from the uart and I want to convert them to hex value. I couldn't find on how to do it in Blocky or in micropython. One of the example I follow on youtube can't be used. The link is https://www.youtube.com/watch?v=SHylh5iaVXI -
-
@iamliubo hi, thanks for the reply.
I managed to do the example from what you gave and I got the results as it is. but, after several checking, I received bytes from the uart. Then, I need to convert to hex. the method i used is:
hexVal = hex(int.from_bytes(serData, "big")) label14.set_text(str(hexVal)) //to show the hexVal to the label
I got the idea from the example you gave and THANK YOU so much for that =)