The range of values from an ANGLE between directly connected to PORT B and connected to PORT A via PbHUB is different
-
Hi,
I'm testing my
PbHUBwith myM5GOandANGLE, and I have a question.When I connect the
ANGLEto port B of theM5GO, the range of values from theANGLEis between 0 and 4095.However, when I connect the
ANGLEto port A via thePbHUBof theM5GO, the range of values from theANGLEis between 15 and 745 (when connected to between ch0 and ch3) or 0 and 715 (when connected to between ch4 and ch5).I confirmed with both Arduino and UIFlow. Is this normal, or my
PbHUBseems to be broken?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)Best,
Shigeru -
of cause, they are different IC to read the raw ADC.
Pbhub use mage328
PortB use ESP32 built-in ADC
ESP32 and mega328 has different ADC resolution
-
@m5stack said in The range of values from an ANGLE between directly connected to PORT B and connected to PORT A via PbHUB is different:
ESP32 and mega328 has different ADC resolution
Thank you very much for your reply.
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...
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