<?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[The range of values from an ANGLE between directly connected to PORT B and connected to PORT A via PbHUB is different]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I'm testing my <code>PbHUB</code> with my <code>M5GO</code> and <code>ANGLE</code>, and I have a question.</p>
<p dir="auto">When I connect the <code>ANGLE</code> to port B of the <code>M5GO</code>, the range of values from the <code>ANGLE</code> is between 0 and 4095.</p>
<p dir="auto">However, when I connect the <code>ANGLE</code> to port A via the <code>PbHUB</code> of the <code>M5GO</code>, the range of values from the <code>ANGLE</code> is between 15 and 745 (when connected to between ch0 and ch3) or 0 and 715 (when connected to between ch4 and ch5).</p>
<p dir="auto">I confirmed with both Arduino and UIFlow. Is this normal, or my <code>PbHUB</code> seems to be broken?</p>
<pre><code>from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit

setScreenColor(0x222222)
pbhub0 = unit.get(unit.PBHUB, unit.PORTA)

label0 = M5TextBox(10, 10, "Text", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)

while True:
  label0.setText(str((str('ANGLE: ') + str((pbhub0.analogRead(0))))))
  wait_ms(100)
  wait_ms(2)
</code></pre>
<p dir="auto">Best,<br />
Shigeru</p>
]]></description><link>https://community.m5stack.com/topic/3310/the-range-of-values-from-an-angle-between-directly-connected-to-port-b-and-connected-to-port-a-via-pbhub-is-different</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 15:36:28 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3310.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 May 2021 00:03:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to The range of values from an ANGLE between directly connected to PORT B and connected to PORT A via PbHUB is different on Fri, 28 May 2021 09:52:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/m5stack" aria-label="Profile: m5stack">@<bdi>m5stack</bdi></a> said in <a href="/post/13903">The range of values from an ANGLE between directly connected to PORT B and connected to PORT A via PbHUB is different</a>:</p>
<blockquote>
<p dir="auto">ESP32 and mega328 has different ADC resolution</p>
</blockquote>
<p dir="auto">Thank you very much for your reply.</p>
<p dir="auto">Yes, the ADC module on mega328 has a 10-bit resolution, whereas ESP32 has a 12-bit resolution. If this issue is just a resolution issue, the result should be 0 - 1023 instead of 15 - 745 or 0 - 715. If nobody can reproduce this issue, the PbHUB may be broken...</p>
]]></description><link>https://community.m5stack.com/post/13914</link><guid isPermaLink="true">https://community.m5stack.com/post/13914</guid><dc:creator><![CDATA[kotobuki]]></dc:creator><pubDate>Fri, 28 May 2021 09:52:43 GMT</pubDate></item><item><title><![CDATA[Reply to The range of values from an ANGLE between directly connected to PORT B and connected to PORT A via PbHUB is different on Thu, 27 May 2021 11:55:07 GMT]]></title><description><![CDATA[<p dir="auto">of cause, they are different IC to read the raw ADC.</p>
<p dir="auto">Pbhub use mage328</p>
<p dir="auto">PortB use ESP32 built-in ADC</p>
<p dir="auto">ESP32 and mega328 has different ADC resolution</p>
]]></description><link>https://community.m5stack.com/post/13903</link><guid isPermaLink="true">https://community.m5stack.com/post/13903</guid><dc:creator><![CDATA[m5stack]]></dc:creator><pubDate>Thu, 27 May 2021 11:55:07 GMT</pubDate></item></channel></rss>