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 labelI got the idea from the example you gave and THANK YOU so much for that =)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login