<?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[StickC Plus + PaHUB + 3 Ultrasonic I2C units]]></title><description><![CDATA[<p dir="auto">Hello!<br />
Today I tried to connect 3 ultrasonic units (I2C) to the StickC Plus controller (UIFlow 1.12.3).<br />
One ultrasonic unit directly connected to the controller works correctly. When I used the PaHub unit then ultrasonic units are not detected. I did some tests and I see that the ultrasonic works fine through PaHub, but only if I set PortA in the port settings of the ultrasonic unit (the same port is set for PaHub). If I select the port PAHUB - PAHUB:0, then the ultrasonic unit is not detected. What am I doing wrong?</p>
]]></description><link>https://community.m5stack.com/topic/5616/stickc-plus-pahub-3-ultrasonic-i2c-units</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 21:59:40 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5616.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 30 Aug 2023 17:26:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Tue, 26 Sep 2023 10:42:40 GMT]]></title><description><![CDATA[<p dir="auto">Continuing my tale-of-woe about the PaHub:</p>
<p dir="auto">I have now tried using G0 and G26 (StickC) to connect as custom I2C to PaHUB with the ENV III attached, which works on Port A.</p>
<p dir="auto">Via the PaHUB using the top hat pins (the pins an I2C hat uses). I get "Pahub unit maybe not connect", fine on Port A.</p>
]]></description><link>https://community.m5stack.com/post/22319</link><guid isPermaLink="true">https://community.m5stack.com/post/22319</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Tue, 26 Sep 2023 10:42:40 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Fri, 22 Sep 2023 15:38:16 GMT]]></title><description><![CDATA[<p dir="auto">Anyone got any more thoughts? My intension is to raise it as a bug (I think we've exhausted our best ideas).</p>
]]></description><link>https://community.m5stack.com/post/22295</link><guid isPermaLink="true">https://community.m5stack.com/post/22295</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Fri, 22 Sep 2023 15:38:16 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Sat, 09 Sep 2023 19:28:41 GMT]]></title><description><![CDATA[<p dir="auto">Interesting from UIFlow2.0, is there a similar global? control for bus speed in UIFlow v1.12.4?<br />
<img src="/assets/uploads/files/1694287650299-screenshot-2023-09-09-at-20.23.36.png" alt="0_1694287668044_Screenshot 2023-09-09 at 20.23.36.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/22201</link><guid isPermaLink="true">https://community.m5stack.com/post/22201</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Sat, 09 Sep 2023 19:28:41 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Fri, 08 Sep 2023 15:24:41 GMT]]></title><description><![CDATA[<p dir="auto">I'd like to get to this, which should be possible using PaHUB and the sensors (easier to assemble with M5Stack with sensors in cases, up to 6 at a 30deg angle to each other).<br />
<img src="/assets/uploads/files/1694186492443-_5jbk6xmvzn-resized.jpeg" alt="0_1694186497256__5jbk6xmVZn.jpeg" class=" img-fluid img-markdown" /><br />
<a href="https://www.hackster.io/user04650005/ultrasound-sensor-array-with-the-hc-sr04-f7108f" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.hackster.io/user04650005/ultrasound-sensor-array-with-the-hc-sr04-f7108f</a></p>
]]></description><link>https://community.m5stack.com/post/22190</link><guid isPermaLink="true">https://community.m5stack.com/post/22190</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Fri, 08 Sep 2023 15:24:41 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Fri, 08 Sep 2023 15:16:35 GMT]]></title><description><![CDATA[<p dir="auto">I tried the example in the following documentation, but I think it is out of date because the blocks are not available as shown in UIFlow <a href="https://docs.m5stack.com/en/uiflow/advanced/i2c" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.m5stack.com/en/uiflow/advanced/i2c</a> (<a class="plugin-mentions-user plugin-mentions-a" href="/user/m5stack" aria-label="Profile: m5stack">@<bdi>m5stack</bdi></a> can this be refreshed please).</p>
<p dir="auto">Basically, I wanted to try and setup an I2C ultrasonic module from vanilla blocks, without Add/+ing the module and in accordance with this Arduino code <a href="https://github.com/m5stack/M5-ProductExampleCodes/blob/master/Unit/ULTRA/Arduino/ULTRA/ULTRA.ino" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5-ProductExampleCodes/blob/master/Unit/ULTRA/Arduino/ULTRA/ULTRA.ino</a> and this <a href="https://www.sgbotic.com/products/datasheets/sensors/sr04_i2c.py" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.sgbotic.com/products/datasheets/sensors/sr04_i2c.py</a> for guidance/inspiration.</p>
<p dir="auto">If I could be confident in the sensor, then maybe move back to the hub, then back to multiple sensors following the Arduino and converting back to vanilla blocks, something like this <a href="https://dronebotworkshop.com/multiple-i2c-bus/" target="_blank" rel="noopener noreferrer nofollow ugc">https://dronebotworkshop.com/multiple-i2c-bus/</a></p>
<p dir="auto">I also tried the "Scan I2C device" block, which doesn't find address of Ultrasonic (0x57) at freq 400000 - fine for ENV III [0x44, 0x70] and PaHub [0x70] – ENV III on its own definitely scans as two addresses. freq reduced to 100000 it finds the ultrasonic address.</p>
<p dir="auto">If I try and use the "Available I2C address in list" block I get I2C bus error (19) message (StickC and Core2), any help appreciated on why.</p>
<p dir="auto">I'd really like to figure this out as I2C ultrasonic sensor arrays would be extremely useful for driving vehicles.</p>
<p dir="auto"><img src="/assets/uploads/files/1694186085183-screenshot-2023-09-08-at-16.14.52.png" alt="0_1694186101089_Screenshot 2023-09-08 at 16.14.52.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/22189</link><guid isPermaLink="true">https://community.m5stack.com/post/22189</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Fri, 08 Sep 2023 15:16:35 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Fri, 08 Sep 2023 09:00:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gavin67890" aria-label="Profile: gavin67890">@<bdi>gavin67890</bdi></a> Yes, you need to change two jumpers (0Ohm) in the IO position and also remove one resistor on the top of the board, which is labeled "IIC".<br />
It was easier for me to short-circuit the contacts than to solder small transistors. So, you just need to unsolder three resistors and then make two short circuits.</p>
<p dir="auto">I think that need just to add a simple function to the PbBoard for ultrasonic sensors like this - <a href="https://github.com/ErickSimoes/Ultrasonic/blob/master/src/Ultrasonic.cpp" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/ErickSimoes/Ultrasonic/blob/master/src/Ultrasonic.cpp</a><br />
Because I can't to it through blocks or python, it's microseconds between send a receive an impulse.</p>
]]></description><link>https://community.m5stack.com/post/22186</link><guid isPermaLink="true">https://community.m5stack.com/post/22186</guid><dc:creator><![CDATA[robot_alf]]></dc:creator><pubDate>Fri, 08 Sep 2023 09:00:38 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Thu, 07 Sep 2023 21:02:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robot_alf" aria-label="Profile: robot_alf">@<bdi>robot_alf</bdi></a>, I can see the 0Ohm? resistors, interesting. Glad to hear at least the conversion worked.</p>
<p dir="auto">Yeah, it's a bit disappointing because it's a common use case, multiples of the same ultrasonic sensors.</p>
<p dir="auto">One thought, could you use the hat GPIO pins at the top of the StickC for the now IO ultrasonic sensor?</p>
]]></description><link>https://community.m5stack.com/post/22184</link><guid isPermaLink="true">https://community.m5stack.com/post/22184</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Thu, 07 Sep 2023 21:02:22 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Thu, 07 Sep 2023 15:44:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gavin67890" aria-label="Profile: gavin67890">@<bdi>gavin67890</bdi></a> yes it works perfect for Core2. I have the problem only on StickC Plus.<br />
Okay, I tried to switch my project from PaHub to PbHub. I have such a hub too. I compared the photo of Ultrasonic I2C and IO versions (thanks a lot to M5 for this) and saw that it can be easily re-soldered I2C to IO. I made an IO out of one I2C sensor and it works fine, but not through PbHub. Actually now I'm at a dead end now ) It looks that I can't make a small mobile machine with two servos360 and three ultrasonic sensors on the StickC Plus (</p>
<p dir="auto">M5 engineers could you please add a function "get distance from ultrasonic" for PbHub?</p>
]]></description><link>https://community.m5stack.com/post/22181</link><guid isPermaLink="true">https://community.m5stack.com/post/22181</guid><dc:creator><![CDATA[robot_alf]]></dc:creator><pubDate>Thu, 07 Sep 2023 15:44:49 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Thu, 07 Sep 2023 13:29:05 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/robot_alf" aria-label="Profile: robot_alf">@<bdi>robot_alf</bdi></a>, I bit the bullet and bought some more hardware. So, now there are two of us in the same position.</p>
<p dir="auto">1x StickC (freshly flashed from M5Burner v1.12.4)<br />
1x M5Stack I2C Hub 1 to 6 Expansion Unit (PCA9548APW) SKU: U040-B<br />
2x M5Stack Ultrasonic Distance Unit I2C (RCWL-9620) SKU: U098-B1</p>
<p dir="auto">Strating from a new UIFlow, click Run, and (drumroll please)... "X Ultrasonic unit maybe not connect", FFS.</p>
<p dir="auto">The good news, I have a ENV III here, so I connected it and got the same error. Take out the Ultrasonic and it works fine (PaHub Added/+ or not). Excellent, so back to the blocks in UIFlow. I can see that the Ultrasonic unit from the ? link is SKU: U098, both of mine are SKU: U098-B1 – the "Sonic" rather than "Ultrasonic", no unit for that in UIFlow. Comparing the notes for U098 vs U098-B1, I came across this line: "This allows for easy I2C integration and multi-sensor operation using a single BUS, to save I/O resources.", interesting.</p>
<p dir="auto">Hmm, [now rummaging around for all sorts of hardware] Groove2Duponts, check, breadboard, check, off we go...</p>
<p dir="auto">Switched to Core2 and transferred all the rest of the hardware, inc. PaHub, same UIFlow setup, and guess what... it works as expected. Two independent readings/labels. NB Keep sensors a little bit apart to avoid cross talk.</p>
<p dir="auto">I tried additionally with power from I2C port of Core2 and no change “X Ultrasonic unit maybe not connect”. Very annoying.</p>
]]></description><link>https://community.m5stack.com/post/22172</link><guid isPermaLink="true">https://community.m5stack.com/post/22172</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Thu, 07 Sep 2023 13:29:05 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Wed, 06 Sep 2023 10:15:34 GMT]]></title><description><![CDATA[<p dir="auto">Hmmm... I did the same several times and always not worked. Which PaHub are you used? I2C Hub 1 to 6 Expansion Unit (PCA9548APW) <a href="https://shop.m5stack.com/products/i2c-hub-1-to-6-expansion-unit-pca9548apw" target="_blank" rel="noopener noreferrer nofollow ugc">https://shop.m5stack.com/products/i2c-hub-1-to-6-expansion-unit-pca9548apw</a> or [EOL] I2C Hub 1 to 6 Expansion Unit (TCA9548A) <a href="https://shop.m5stack.com/products/pahub-unit?variant=16804803412058" target="_blank" rel="noopener noreferrer nofollow ugc">https://shop.m5stack.com/products/pahub-unit?variant=16804803412058</a> ?</p>
]]></description><link>https://community.m5stack.com/post/22163</link><guid isPermaLink="true">https://community.m5stack.com/post/22163</guid><dc:creator><![CDATA[robot_alf]]></dc:creator><pubDate>Wed, 06 Sep 2023 10:15:34 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Wed, 06 Sep 2023 06:00:32 GMT]]></title><description><![CDATA[<p dir="auto">For reference/comparison. From drag and drop controls in UIFlow, I added the PaHUB first then 3x Ultrasonics (sub images pasted in and config as shown bottom right). The loop I know to work from my StickC and Ultrasonic unit. Drag in 3x labels and connect the dots.<br />
<img src="/assets/uploads/files/1693979493477-screenshot-2023-09-06-at-06.46.52-resized.png" alt="0_1693979509477_Screenshot 2023-09-06 at 06.46.52.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1693979897183-screenshot-2023-09-06-at-06.57.32-resized.png" alt="0_1693979912312_Screenshot 2023-09-06 at 06.57.32.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/22161</link><guid isPermaLink="true">https://community.m5stack.com/post/22161</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Wed, 06 Sep 2023 06:00:32 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Tue, 05 Sep 2023 22:21:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robot_alf" aria-label="Profile: robot_alf">@<bdi>robot_alf</bdi></a> That's encouraging.<br />
I take that label0 is Ultrasonic_0<br />
, label1 is Ultrasonic_1<br />
, label2 is Ultrasonic_2<br />
What happens if you complete the three unit ultrasonic set (by adding (Add/+) two more Ultrasonic units)?<br />
Have you tried increasing the Wait?</p>
]]></description><link>https://community.m5stack.com/post/22160</link><guid isPermaLink="true">https://community.m5stack.com/post/22160</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Tue, 05 Sep 2023 22:21:28 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Tue, 05 Sep 2023 22:14:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robot_alf" aria-label="Profile: robot_alf">@<bdi>robot_alf</bdi></a> "<em>need to connect sensors to 1,2,3 ports of pahub, not to 0,1,2"</em></p>
<p dir="auto">There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors :D</p>
]]></description><link>https://community.m5stack.com/post/22159</link><guid isPermaLink="true">https://community.m5stack.com/post/22159</guid><dc:creator><![CDATA[mtylerjr]]></dc:creator><pubDate>Tue, 05 Sep 2023 22:14:38 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Tue, 05 Sep 2023 21:12:51 GMT]]></title><description><![CDATA[<p dir="auto">This code also working but need to connect sensors to 1,2,3 ports of pahub, not to 0,1,2</p>
<pre><code>#include &lt;M5StickCPlus.h&gt;
#include &lt;Unit_Sonic.h&gt;
#include "ClosedCube_TCA9548A.h"

#define PaHub_I2C_ADDRESS 0x70
ClosedCube::Wired::TCA9548A tca9548a;

SONIC_I2C sensor;

void setup() {
    M5.begin();
    tca9548a.address(PaHub_I2C_ADDRESS);
    sensor.begin();
    M5.Lcd.setTextFont(2);
}

void loop() {
  static float newvalue = 0;
  for (uint8_t channel = 0; channel &lt; 3; channel++) {
    tca9548a.selectChannel(channel);
    M5.Lcd.printf("%i = ", channel);
    newvalue = sensor.getDistance();
    if ((newvalue &lt; 4000) &amp;&amp; (newvalue &gt; 20)) {
      M5.Lcd.printf("%.2fmm   ", newvalue);
    } else {
      M5.Lcd.print("ERR        ");
    }
    M5.Lcd.print("\n");
  }
  delay(20);
  M5.Lcd.setCursor(0,0);
}</code></pre>
]]></description><link>https://community.m5stack.com/post/22157</link><guid isPermaLink="true">https://community.m5stack.com/post/22157</guid><dc:creator><![CDATA[robot_alf]]></dc:creator><pubDate>Tue, 05 Sep 2023 21:12:51 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Tue, 05 Sep 2023 20:53:03 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1693946442891-4a3ee96e-095d-4cd6-b8ab-4c08594362e2-image-resized.png" alt="0_1693946459135_4a3ee96e-095d-4cd6-b8ab-4c08594362e2-image.png" class=" img-fluid img-markdown" /><br />
This is crazy but this code working with 3 sensors )<br />
The pahub and ultrasonic was selected to PortA. And sometimes I see distance from incorrect sensor. I think again that hardware part is working, but code for StickC Plus controllers have some bugs.<br />
M5Stack engineers, could you please send me python libraries for pahub and ultrasonic? Maybe I can help to investigate the problem. I don't want to spend time for reverse engineering them from bin-file of UIFlow firmware )</p>
]]></description><link>https://community.m5stack.com/post/22156</link><guid isPermaLink="true">https://community.m5stack.com/post/22156</guid><dc:creator><![CDATA[robot_alf]]></dc:creator><pubDate>Tue, 05 Sep 2023 20:53:03 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Tue, 05 Sep 2023 20:40:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gavin67890" aria-label="Profile: gavin67890">@<bdi>gavin67890</bdi></a> Download not working. I think it is the same like run app just the controller switched to the "app" mode instead of "internet" mode.</p>
]]></description><link>https://community.m5stack.com/post/22155</link><guid isPermaLink="true">https://community.m5stack.com/post/22155</guid><dc:creator><![CDATA[robot_alf]]></dc:creator><pubDate>Tue, 05 Sep 2023 20:40:35 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Tue, 05 Sep 2023 12:57:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robot_alf" aria-label="Profile: robot_alf">@<bdi>robot_alf</bdi></a> Have you tried Download rather than just Run from UIFlow? I had it on another project that refused to Run, but worked OK from Download.</p>
<p dir="auto">Other than that, perhaps just recheck all again from the top, right StickC model (original or Plus), right units for PaHUB and Ultrasonic, etc. Did you want to add some screenshots from UIFlow, Blocky, Python, etc. Maybe with a few pairs of eyes we can spot something (remember to hide your API Key).</p>
]]></description><link>https://community.m5stack.com/post/22152</link><guid isPermaLink="true">https://community.m5stack.com/post/22152</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Tue, 05 Sep 2023 12:57:50 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Tue, 05 Sep 2023 09:07:18 GMT]]></title><description><![CDATA[<p dir="auto">Hello guys</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/teastain" aria-label="Profile: teastain">@<bdi>teastain</bdi></a> : See example <a href="https://docs.espressif.com/projects/arduino-esp32/en/latest/api/i2c.html#i2c-slave-mode" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gavin67890" aria-label="Profile: gavin67890">@<bdi>gavin67890</bdi></a> : yes it still works when I add PaHub as unit on Port A.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robot_alf" aria-label="Profile: robot_alf">@<bdi>robot_alf</bdi></a> : have you tried something similar in UiFlow/Micropython? E.g. only adding one Ultrasontic unit and then manually select the PaHub port/channel?</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/22151</link><guid isPermaLink="true">https://community.m5stack.com/post/22151</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Tue, 05 Sep 2023 09:07:18 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Tue, 05 Sep 2023 08:02:49 GMT]]></title><description><![CDATA[<p dir="auto">I have made a simple test for Arduino and it works. It show that hardware part is working correct need just fix the problem in the code for UIFlow.</p>
<pre><code>#include &lt;M5StickCPlus.h&gt;
#include &lt;Unit_Sonic.h&gt;
#include "ClosedCube_TCA9548A.h"

#define PaHub_I2C_ADDRESS 0x70
ClosedCube::Wired::TCA9548A tca9548a;

SONIC_I2C sensor;

void setup() {
    M5.begin();
    tca9548a.address(PaHub_I2C_ADDRESS);
    sensor.begin();
    M5.Lcd.setTextFont(2);
    M5.Lcd.setTextColor(YELLOW, TFT_BLACK);
    M5.Lcd.println(("PaHUB Example"));
    M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
}

void loop() {
  static float newvalue = 0;
  for (uint8_t channel = 0; channel &lt; 6; channel++) {
    tca9548a.selectChannel(channel);
    M5.Lcd.print(channel);
    M5.Lcd.print(" = ");
    newvalue = sensor.getDistance();
    if ((newvalue &lt; 4000) &amp;&amp; (newvalue &gt; 20)) {
      M5.Lcd.printf("%.2fmm", newvalue);
    } else {
      M5.Lcd.print("ERR");
    }
    M5.Lcd.print("\n");
  }
  delay(20);
  M5.Lcd.fillScreen(BLACK);
  M5.Lcd.setCursor(0,0);
}
</code></pre>
]]></description><link>https://community.m5stack.com/post/22150</link><guid isPermaLink="true">https://community.m5stack.com/post/22150</guid><dc:creator><![CDATA[robot_alf]]></dc:creator><pubDate>Tue, 05 Sep 2023 08:02:49 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Tue, 05 Sep 2023 07:56:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> looks like the same code that return "ultrasonic not found" at start, but I will check it.</p>
]]></description><link>https://community.m5stack.com/post/22149</link><guid isPermaLink="true">https://community.m5stack.com/post/22149</guid><dc:creator><![CDATA[robot_alf]]></dc:creator><pubDate>Tue, 05 Sep 2023 07:56:20 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Mon, 04 Sep 2023 21:53:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Out of curiosity, could you try adding PaHub as a unit (Port A) and see if everything still works correctly?</p>
]]></description><link>https://community.m5stack.com/post/22148</link><guid isPermaLink="true">https://community.m5stack.com/post/22148</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Mon, 04 Sep 2023 21:53:39 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Mon, 04 Sep 2023 20:48:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Hi Felix, where can I find more information on I2C slaves?<br />
I could never get Master/Slave to work on ESP32.<br />
A snippet of sample code would be REALY(!) nice.<br />
Thanks. -Terry</p>
]]></description><link>https://community.m5stack.com/post/22147</link><guid isPermaLink="true">https://community.m5stack.com/post/22147</guid><dc:creator><![CDATA[teastain]]></dc:creator><pubDate>Mon, 04 Sep 2023 20:48:54 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Mon, 04 Sep 2023 19:56:31 GMT]]></title><description><![CDATA[<p dir="auto">Hello guys</p>
<p dir="auto">the following worked for me (M5StickCPlus fw 1.12.3, PaHub, 2x ultrasonic unit *)).</p>
<p dir="auto">*) I don't actually have an ultrasonic unit - I simulated two of them with two ESP32C3 acting as I2C slaves on address 0x57.</p>
<p dir="auto">Note: I did <strong>not</strong> add PaHub as unit. Just the two Ultrasonic units.</p>
<pre><code>from m5stack import *
from m5ui import *
from uiflow import *
import unit

setScreenColor(0x111111)
Ultrasonic_0 = unit.get(unit.ULTRASONIC, unit.PAHUB0)
Ultrasonic_1 = unit.get(unit.ULTRASONIC, unit.PAHUB1)

label0 = M5TextBox(37, 38, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label1 = M5TextBox(38, 115, "label1", lcd.FONT_Default, 0xFFFFFF, rotate=0)

label0.setText(str(Ultrasonic_0.distance))
label1.setText(str(Ultrasonic_1.distance))
</code></pre>
<p dir="auto">Edit: I just thrown in four additional I2C units (RFID, EXT.IO2, Gesture and 4 Relay), all connected to the PaHub and everything still works fine for me.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/22146</link><guid isPermaLink="true">https://community.m5stack.com/post/22146</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 04 Sep 2023 19:56:31 GMT</pubDate></item><item><title><![CDATA[Reply to StickC Plus + PaHUB + 3 Ultrasonic I2C units on Mon, 04 Sep 2023 16:58:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robot_alf" aria-label="Profile: robot_alf">@<bdi>robot_alf</bdi></a>, It would mean a switch to Arduino, but maybe this would help with fault finding (example for PaHub, which happens to use StickC) <a href="https://github.com/m5stack/M5StickC/blob/master/examples/Unit/PaHUB/PaHUB.ino" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5StickC/blob/master/examples/Unit/PaHUB/PaHUB.ino</a><br />
I'm thinking scan down through the tree to see where it's connected.</p>
]]></description><link>https://community.m5stack.com/post/22145</link><guid isPermaLink="true">https://community.m5stack.com/post/22145</guid><dc:creator><![CDATA[gavin67890]]></dc:creator><pubDate>Mon, 04 Sep 2023 16:58:34 GMT</pubDate></item></channel></rss>