<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Convert string to hex]]></title><description><![CDATA[<p dir="auto">Hi all..<br />
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 <a href="https://www.youtube.com/watch?v=SHylh5iaVXI" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.youtube.com/watch?v=SHylh5iaVXI</a></p>
]]></description><link>https://community.m5stack.com/topic/5452/convert-string-to-hex</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 03:46:06 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5452.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Jul 2023 06:34:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Convert string to hex on Mon, 03 Jul 2023 08:01:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/iamliubo" aria-label="Profile: iamliubo">@<bdi>iamliubo</bdi></a> hi, thanks for the reply.</p>
<p dir="auto">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:</p>
<pre><code>hexVal = hex(int.from_bytes(serData, "big"))
label14.set_text(str(hexVal)) //to show the hexVal to the label
</code></pre>
<p dir="auto">I got the idea from the example you gave and THANK YOU so much for that =)</p>
]]></description><link>https://community.m5stack.com/post/21457</link><guid isPermaLink="true">https://community.m5stack.com/post/21457</guid><dc:creator><![CDATA[shahabdhafiz]]></dc:creator><pubDate>Mon, 03 Jul 2023 08:01:31 GMT</pubDate></item><item><title><![CDATA[Reply to Convert string to hex on Mon, 03 Jul 2023 07:00:15 GMT]]></title><description><![CDATA[<p dir="auto">hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/shahabdhafiz" aria-label="Profile: shahabdhafiz">@<bdi>shahabdhafiz</bdi></a></p>
<p dir="auto">You can try this way:</p>
<pre><code class="language-python">a = "0x0A"
b = int(a, 16)
print(b)
</code></pre>
<p dir="auto">docs is here: <a href="https://docs.python.org/3/library/functions.html#int" target="_blank" rel="noopener noreferrer nofollow ugc">link</a></p>
]]></description><link>https://community.m5stack.com/post/21454</link><guid isPermaLink="true">https://community.m5stack.com/post/21454</guid><dc:creator><![CDATA[IAMLIUBO]]></dc:creator><pubDate>Mon, 03 Jul 2023 07:00:15 GMT</pubDate></item></channel></rss>