<?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[Imu.getAccel() returns gyro values ???]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">there was a similar question 4 years ago realting to uiflow1 under the following URL:<br />
<a href="https://community.m5stack.com/topic/1672/imu-get-acc-reports-gyro">https://community.m5stack.com/topic/1672/imu-get-acc-reports-gyro</a></p>
<p dir="auto">There are 2 blocks in IMU for accel and gyro! IMU get accel and IMU get gyro.</p>
<p dir="auto">It seems that the returned values in both of both functions are gyro values. UIFlow generates the following code, and in the variables beschlx and beschly are identical values, namely gyro values. Furthermore it seems that the function does not return sperate values for x,y,z. Or is the return value a triple and I have to split the values somehow?</p>
<p dir="auto">def loop():<br />
global label0, label1, label2, label3, label4, label5, beschlx, beschly, beschlz<br />
M5.update()<br />
beschlx = Imu.getAccel()<br />
beschly = Imu.getGyro()<br />
beschlz = Imu.getAccel()<br />
label3.setText(str(beschlx))<br />
label4.setText(str(beschly))<br />
label5.setText(str(beschlz))</p>
<p dir="auto">Best regards,<br />
Nestor</p>
]]></description><link>https://community.m5stack.com/topic/5561/imu-getaccel-returns-gyro-values</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 18:22:28 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5561.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 09 Aug 2023 15:07:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Imu.getAccel() returns gyro values ??? on Mon, 21 Aug 2023 01:32:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/50028">@Nestor89</a> It has been fixed.</p>
]]></description><link>https://community.m5stack.com/post/22014</link><guid isPermaLink="true">https://community.m5stack.com/post/22014</guid><dc:creator><![CDATA[lbuque]]></dc:creator><pubDate>Mon, 21 Aug 2023 01:32:23 GMT</pubDate></item><item><title><![CDATA[Reply to Imu.getAccel() returns gyro values ??? on Wed, 09 Aug 2023 16:22:13 GMT]]></title><description><![CDATA[<p dir="auto">Hi I figured out that Imu.getGyro()  returns a tuple of 3 values and that a tuple can be considered as a list. The following code works to seperate the tuple:</p>
<p dir="auto">def loop():<br />
global label0, label1, label2, label3, label4, label5, highscorebeschl, beschly, beschlx, beschltuple, beschlz<br />
M5.update()<br />
beschltuple = Imu.getGyro()<br />
beschlx = beschltuple[0]<br />
beschly = beschltuple[1]<br />
beschlz = beschltuple[2]<br />
label3.setText(str(beschlx))<br />
label4.setText(str(beschly))<br />
label5.setText(str(beschlz))</p>
<p dir="auto">in blockly the block in list ... get # ... can be used<br />
However blockly counts from 1 to 3 while the generated phython code counts from 0 to 2.</p>
<p dir="auto">So in the end the question remains why Imu.getGyro() and Imu.getAccel()  return the values of the other function.</p>
<p dir="auto">Best regards,<br />
Nestor</p>
]]></description><link>https://community.m5stack.com/post/21846</link><guid isPermaLink="true">https://community.m5stack.com/post/21846</guid><dc:creator><![CDATA[Nestor89]]></dc:creator><pubDate>Wed, 09 Aug 2023 16:22:13 GMT</pubDate></item><item><title><![CDATA[Reply to Imu.getAccel() returns gyro values ??? on Wed, 09 Aug 2023 15:43:55 GMT]]></title><description><![CDATA[<p dir="auto">I have to correct myself.<br />
I work with an atom S3 right now.</p>
<p dir="auto">Imu.getAccel() returns values between -1 and 1 depending on the inclination of the atom S3.<br />
Imu.getGyro() returns values at least up to 30  depending on the velocity of movement of the atom S3.</p>
<p dir="auto">It looks like the functions each return the value for the other function. Are the functions implemented incorrectly or is the sensor wired incorrectly?</p>
<p dir="auto">Furthermore how can i access the x,y,z values? The blocks do not seem to have a parameter (There were blocks in uiflow 1 for x,y,z each) Are the values returned as a triple which needs to get sperated somehow?</p>
<p dir="auto">Best regards,<br />
Nestor</p>
]]></description><link>https://community.m5stack.com/post/21845</link><guid isPermaLink="true">https://community.m5stack.com/post/21845</guid><dc:creator><![CDATA[Nestor89]]></dc:creator><pubDate>Wed, 09 Aug 2023 15:43:55 GMT</pubDate></item></channel></rss>