<?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[M5Stack fire gyro mpu6050]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I just received my M5 Fire + m5bala this morning.<br />
The M5 fire device is great. I played with M5 library with success (from Arduino) and managed to get some Hello world and other stuff running.</p>
<p dir="auto">My problem is when I run the m5bala sample.<br />
I did managed to compile and upload the sample, but the code won't work.</p>
<p dir="auto">After some debugging, it appears that I can drive the motors correctly by setting manual commands.<br />
However, the MPU6050 seems to be not responding as expected since I always have zero values.</p>
<p dir="auto">Here is a piece of code I use to test the MPU. I  tried different versions of MPU6050 library with no difference.<br />
Any help is welcome, thank you.</p>
<p dir="auto">Regards</p>
<p dir="auto">#include &lt;M5Stack.h&gt;<br />
#include &lt;MPU6050_tockn.h&gt;<br />
#include &lt;Wire.h&gt;</p>
<p dir="auto">MPU6050 mpu6050(Wire);</p>
<p dir="auto">void setup()<br />
{<br />
// Power ON Stabilizing...<br />
delay(500);<br />
M5.begin();<br />
M5.setPowerBoostKeepOn(false);</p>
<pre><code>Wire.begin();
Wire.setClock(400000UL);  // Set I2C frequency to 400kHz

mpu6050.begin();
mpu6050.calcGyroOffsets(false);
//mpu6050.setGyroOffsets(-2.70, -1.08, 0.87);

M5.Lcd.setTextFont(2);
M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
M5.Lcd.println("M5Stack Balance Mode start");
</code></pre>
<p dir="auto">}</p>
<p dir="auto">void loop()<br />
{<br />
mpu6050.update();<br />
M5.Lcd.clear();<br />
M5.Lcd.setCursor(0, 0);<br />
M5.Lcd.printf("X: %f", mpu6050.getAngleX());<br />
M5.Lcd.setCursor(0, 20);<br />
M5.Lcd.printf("Y: %f", mpu6050.getAngleY());<br />
M5.Lcd.setCursor(0, 40);<br />
M5.Lcd.printf("Z: %f", mpu6050.getAngleZ());<br />
delay(500);<br />
// M5 Loop<br />
M5.update();<br />
}</p>
]]></description><link>https://community.m5stack.com/topic/325/m5stack-fire-gyro-mpu6050</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 05:21:51 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/325.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 15 Sep 2018 21:16:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5Stack fire gyro mpu6050 on Tue, 25 Sep 2018 20:32:11 GMT]]></title><description><![CDATA[<p dir="auto">Ok, it seems that the problem was due to my version of ESP32 tools.<br />
I updated my ESP32 framework and now the code is working fine.</p>
<p dir="auto">Also, I used PlatformIO in VSCode which make things simpler since it enables the M5STACK_FIRE flag during compilation.</p>
]]></description><link>https://community.m5stack.com/post/1598</link><guid isPermaLink="true">https://community.m5stack.com/post/1598</guid><dc:creator><![CDATA[ItHasU]]></dc:creator><pubDate>Tue, 25 Sep 2018 20:32:11 GMT</pubDate></item></channel></rss>