<?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[M5StickC Plus MicroPython: Use GPIO 25 and 26 for I2C, 36 Floating]]></title><description><![CDATA[<p dir="auto">Hi, I would like to use the GPIO 25 and 26 pins in the header for I2C, so I am setting them up as follows in MicroPython:</p>
<p dir="auto"><em>from machine import Pin, I2C<br />
i2c = I2C(1, scl=Pin(26), sda=Pin(25), freq=400000)</em></p>
<p dir="auto">However, the description says that "G36/G25 share the same port, when one of the pins is used, the other pin should be set as a floating input" and provides the following example</p>
<p dir="auto"><em>For example, to use the G36 pin as the ADC input, Configuration the G25 pin as FLOATING<br />
setup()<br />
{<br />
M5.begin();<br />
pinMode(36, INPUT);<br />
gpio_pulldown_dis(GPIO_NUM_25);<br />
gpio_pullup_dis(GPIO_NUM_25);<br />
}</em></p>
<p dir="auto">It seems that I should set GPIO36 to Floating.  How does one do this in MicroPython, and where could one find such settings in the documentation?  I have looked for a couple of hours and can't find this anywhere.</p>
<p dir="auto">Jack<br />
PS How do you create a code window on this board?</p>
]]></description><link>https://community.m5stack.com/topic/2386/m5stickc-plus-micropython-use-gpio-25-and-26-for-i2c-36-floating</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 11:29:54 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2386.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 18 Oct 2020 08:08:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5StickC Plus MicroPython: Use GPIO 25 and 26 for I2C, 36 Floating on Sun, 18 Oct 2020 17:08:51 GMT]]></title><description><![CDATA[<p dir="auto">Hello Jack</p>
<p dir="auto">you are welcome and thank you.</p>
<p dir="auto">You'll need to check the <a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/MPU-6886-000193%2Bv1.1_GHIC_en.pdf" target="_blank" rel="noopener noreferrer nofollow ugc">MPU6886 datasheet</a></p>
<p dir="auto">There is a sleep mode bit (Bit 6) in register 107 (power management 1). When I read that register I get 0x01 which seems to be the default. To put MPU6886 into sleep mode I'd write 0x41 into that register like that:</p>
<pre><code>import i2c_bus
i2c0 = i2c_bus.easyI2C(i2c_bus.PORTA, 0x68, freq=400000)
i2c0.write_u8(107, 0x41)
</code></pre>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/10391</link><guid isPermaLink="true">https://community.m5stack.com/post/10391</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Sun, 18 Oct 2020 17:08:51 GMT</pubDate></item><item><title><![CDATA[Reply to M5StickC Plus MicroPython: Use GPIO 25 and 26 for I2C, 36 Floating on Sun, 18 Oct 2020 14:09:18 GMT]]></title><description><![CDATA[<p dir="auto">Excellent, thank you very much Felix.  And nice informative site you have there!</p>
<p dir="auto">May I ask how you ensure that MPU6886 is off in MicroPython?</p>
]]></description><link>https://community.m5stack.com/post/10385</link><guid isPermaLink="true">https://community.m5stack.com/post/10385</guid><dc:creator><![CDATA[JackH]]></dc:creator><pubDate>Sun, 18 Oct 2020 14:09:18 GMT</pubDate></item><item><title><![CDATA[Reply to M5StickC Plus MicroPython: Use GPIO 25 and 26 for I2C, 36 Floating on Sun, 18 Oct 2020 09:50:15 GMT]]></title><description><![CDATA[<p dir="auto">Hello Jack</p>
<p dir="auto">you could try the following to make GPIO36 floating:</p>
<pre><code>p36 = Pin(36, Pin.IN, None)
</code></pre>
<p dir="auto">Please note: I do not own a M5StickC Plus so I've tried above code on a M5Stack Fire. It runs without error.</p>
<p dir="auto">That said, I don't think GPIO36 has internal pull-up or pull-down circuitry to begin with since the following code did not change the voltage reading at all:</p>
<pre><code>p36 = Pin(36, Pin.IN, Pin.PULL_UP)
</code></pre>
<p dir="auto">BTW: When I define a pull-up for let's say GPIO25 the voltage goes up to about 3.2 volts as I would expect.</p>
<p dir="auto">For reference: <a href="https://docs.micropython.org/en/latest/library/machine.Pin.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.micropython.org/en/latest/library/machine.Pin.html</a></p>
<p dir="auto">Cheers<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/10380</link><guid isPermaLink="true">https://community.m5stack.com/post/10380</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Sun, 18 Oct 2020 09:50:15 GMT</pubDate></item></channel></rss>