<?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[Any updates on the mpu6886?]]></title><description><![CDATA[<p dir="auto">Can this be used somehow?<br />
i haven't found any examples.</p>
]]></description><link>https://community.m5stack.com/topic/1377/any-updates-on-the-mpu6886</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Mar 2026 08:29:42 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1377.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 11 Oct 2019 15:03:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Any updates on the mpu6886? on Tue, 05 Jul 2022 12:14:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2230">@staberas</a></p>
<p dir="auto">This code was very helpful. Thanks!</p>
<p dir="auto">I tried adding temperature as well:</p>
<pre><code>tmp = i2c.readfrom_mem(MPU6886_ADDRESS, MPU6886_TEMP_OUT_H, 2)
temp = (tmp[0]&lt;&lt;8|tmp[1])
temp = (float(temp) / 326.8) + 25.0;
</code></pre>
<p dir="auto">I'm getting temps of 40.5C (105F). Am I doing something wrong or is this temperature the CPU temp?</p>
<p dir="auto">Thanks,<br />
/Chris</p>
]]></description><link>https://community.m5stack.com/post/17913</link><guid isPermaLink="true">https://community.m5stack.com/post/17913</guid><dc:creator><![CDATA[purpledread]]></dc:creator><pubDate>Tue, 05 Jul 2022 12:14:14 GMT</pubDate></item><item><title><![CDATA[Reply to Any updates on the mpu6886? on Wed, 20 May 2020 02:38:01 GMT]]></title><description><![CDATA[<p dir="auto">you could find the MPU6886 example in this page:</p>
<p dir="auto"><a href="https://docs.m5stack.com/#/en/related_documents/M5StickV-Maixpy" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.m5stack.com/#/en/related_documents/M5StickV-Maixpy</a></p>
]]></description><link>https://community.m5stack.com/post/8742</link><guid isPermaLink="true">https://community.m5stack.com/post/8742</guid><dc:creator><![CDATA[m5stack]]></dc:creator><pubDate>Wed, 20 May 2020 02:38:01 GMT</pubDate></item><item><title><![CDATA[Reply to Any updates on the mpu6886? on Tue, 19 May 2020 20:07:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2230">@staberas</a> I'm trying to run your example on the M5Stick V but I have a error message when trying to write_i2c for the first time. The error is: "OSError: [Errno 5] EIO". Do you know what does it means?</p>
]]></description><link>https://community.m5stack.com/post/8736</link><guid isPermaLink="true">https://community.m5stack.com/post/8736</guid><dc:creator><![CDATA[Alisson Brito]]></dc:creator><pubDate>Tue, 19 May 2020 20:07:28 GMT</pubDate></item><item><title><![CDATA[Reply to Any updates on the mpu6886? on Thu, 13 Feb 2020 11:49:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2960">@bryam</a><br />
The code above is for the maixpy (micropython) not arduino</p>
]]></description><link>https://community.m5stack.com/post/7382</link><guid isPermaLink="true">https://community.m5stack.com/post/7382</guid><dc:creator><![CDATA[staberas]]></dc:creator><pubDate>Thu, 13 Feb 2020 11:49:43 GMT</pubDate></item><item><title><![CDATA[Reply to Any updates on the mpu6886? on Sun, 09 Feb 2020 21:59:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2230">@staberas</a> Como lo instalas no me reconoce si creo un ide en arduino</p>
]]></description><link>https://community.m5stack.com/post/7334</link><guid isPermaLink="true">https://community.m5stack.com/post/7334</guid><dc:creator><![CDATA[Bryam]]></dc:creator><pubDate>Sun, 09 Feb 2020 21:59:55 GMT</pubDate></item><item><title><![CDATA[Reply to Any updates on the mpu6886? on Sat, 09 Nov 2019 10:37:17 GMT]]></title><description><![CDATA[<p dir="auto">done, used party code from <a href="https://anoken.jimdo.com/" target="_blank" rel="noopener noreferrer nofollow ugc">anoken</a> who sourced it from the arduino version , i clean up and updated it</p>
<pre><code>import image
import lcd
import sensor
import sys
import time
import utime
from board import board_info
import KPU as kpu
from Maix import GPIO
from fpioa_manager import *
from pmu import axp192 
from machine import I2C
#pmu = axp192() - breaks IMU data -
#pmu.enablePMICSleepMode(True) - breaks IMU data -

i2c = I2C(I2C.I2C0, freq=400000, scl=28, sda=29)
#devices = i2c.scan()
lcd.init()

# IMU6866 define
MPU6886_ADDRESS=0x68
MPU6886_WHOAMI=0x75
MPU6886_ACCEL_INTEL_CTRL=0x69
MPU6886_SMPLRT_DIV=0x19
MPU6886_INT_PIN_CFG=0x37
MPU6886_INT_ENABLE=0x38
MPU6886_ACCEL_XOUT_H=0x3B
MPU6886_TEMP_OUT_H=0x41
MPU6886_GYRO_XOUT_H=0x43
MPU6886_USER_CTRL= 0x6A
MPU6886_PWR_MGMT_1=0x6B
MPU6886_PWR_MGMT_2=0x6C
MPU6886_CONFIG=0x1A
MPU6886_GYRO_CONFIG=0x1B
MPU6886_ACCEL_CONFIG=0x1C
MPU6886_ACCEL_CONFIG2=0x1D
MPU6886_FIFO_EN=0x23

# IMU6866 Initialize
def write_i2c(address, value):
	i2c.writeto_mem(MPU6886_ADDRESS, address, bytearray([value]))
	time.sleep_ms(10)

write_i2c(MPU6886_PWR_MGMT_1, 0x00)
write_i2c(MPU6886_PWR_MGMT_1, 0x01&lt;&lt;7)
write_i2c(MPU6886_PWR_MGMT_1,0x01&lt;&lt;0)
write_i2c(MPU6886_ACCEL_CONFIG,0x10)
write_i2c(MPU6886_GYRO_CONFIG,0x18)
write_i2c(MPU6886_CONFIG,0x01)
write_i2c(MPU6886_SMPLRT_DIV,0x05)
write_i2c(MPU6886_INT_ENABLE,0x00)
write_i2c(MPU6886_ACCEL_CONFIG2,0x00)
write_i2c(MPU6886_USER_CTRL,0x00)
write_i2c(MPU6886_FIFO_EN,0x00)
write_i2c(MPU6886_INT_PIN_CFG,0x22)
write_i2c(MPU6886_INT_ENABLE,0x01)

# Read IMU6866 and Scaling
def read_imu():
	aRes=255/4096/2
	gRes = 2000.0/32768.0
	offset=128
	accel = i2c.readfrom_mem(MPU6886_ADDRESS, MPU6886_ACCEL_XOUT_H, 6)
	accel_x = (accel[0]&lt;&lt;8|accel[1])
	accel_y = (accel[2]&lt;&lt;8|accel[3])
	accel_z = (accel[4]&lt;&lt;8|accel[5])
	if accel_x&gt;32768:
		accel_x=accel_x-65536
	if accel_y&gt;32768:
		accel_y=accel_y-65536
	if accel_z&gt;32768:
		accel_z=accel_z-65536
	ax=int(accel_x*aRes+offset)
	if ax&lt;0: ax=0
	if ax&gt;255: ax=255
	ay=int(accel_y*aRes+offset)
	if ay&lt;0: ay=0
	if ay&gt;255: ay=255
	az=int(accel_z*aRes+offset)
	if az&lt;0: az=0
	if az&gt;255: az=255
	accel_array = [ax,ay,az]
	gyro = i2c.readfrom_mem(MPU6886_ADDRESS, MPU6886_GYRO_XOUT_H, 6)
	gyro_x = (gyro[0]&lt;&lt;8|gyro[1])
	gyro_y = (gyro[2]&lt;&lt;8|gyro[3])
	gyro_z = (gyro[4]&lt;&lt;8|gyro[5])
	if gyro_x&gt;32768:
		gyro_x=gyro_x-65536
	if gyro_y&gt;32768:
		gyro_y=gyro_y-65536
	if gyro_z&gt;32768:
		gyro_z=gyro_z-65536
	gx=int(gyro_x*gRes+offset)
	if gx&lt;0: gx=0
	if gx&gt;255: gx=255
	gy=int(gyro_y*gRes+offset)
	if gy&lt;0: gy=0
	if gy&gt;255: gy=255
	gz=int(gyro_x*gRes+offset)
	if gz&lt;0: gz=0
	if gz&gt;255: gz=255
	gyro_array = [gx,gy,gz]
	return accel_array, gyro_array


lcd.rotation(2)
task = kpu.load("/sd/7118109ae3ea570e_mbnet10_quant.kmodel")#change model
labels=["seadog","Borbya","mermaid","Villo"] #change names.
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.set_windowing((224, 224))
sensor.run(1)
lcd.clear()
while(True):
	accel_array,gyro_array = read_imu()
	img = sensor.snapshot()
	fmap = kpu.forward(task,img)
	plist=fmap[:]
	pmax=max(plist)
	#lcd.draw_string(40, 20, str(accel_array))
	#lcd.draw_string(10, 40, str(gyro_array))
	max_index=plist.index(pmax)
	if pmax &gt; 0.95:
		#lcd.draw_string(40, 60, "Accu:%.2f Type:%s"%(pmax, labels[max_index].strip()))  #20-59,130-136,55-30 [side view] 100-130,130-136,9-20 [top view] 
        #the values are from 0 to 255 
		if accel_array[0] &gt; 20 and accel_array[0] &lt; 59 and accel_array[1] &gt; 130 and accel_array[1] &lt; 136 and accel_array[2] &gt; 30 and accel_array[2] &lt; 55:
			img.draw_image(image.Image("/sd/view2.jpg"), 50, 50,x_scale=0.5,y_scale=0.5,mask=image.Image("/sd/view2t.jpg"))
		if accel_array[0] &gt; 60  and accel_array[0] &lt; 130 and accel_array[1] &gt; 130  and accel_array[1] &lt; 137 and accel_array[2] &gt; 8 and accel_array[2] &lt; 20:
			img.draw_image(image.Image("/sd/view1.jpg"), 50, 50,x_scale=0.5,y_scale=0.5,mask=image.Image("/sd/view1t.jpg"))
	a = lcd.display(img)
a = kpu.deinit(task)
sys.exit()
</code></pre>
]]></description><link>https://community.m5stack.com/post/6301</link><guid isPermaLink="true">https://community.m5stack.com/post/6301</guid><dc:creator><![CDATA[staberas]]></dc:creator><pubDate>Sat, 09 Nov 2019 10:37:17 GMT</pubDate></item><item><title><![CDATA[Reply to Any updates on the mpu6886? on Wed, 06 Nov 2019 08:02:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2191">@xeon</a> sorry for resurrecting old post, i had the same problem, i currently close getting data from the IMU</p>
]]></description><link>https://community.m5stack.com/post/6276</link><guid isPermaLink="true">https://community.m5stack.com/post/6276</guid><dc:creator><![CDATA[staberas]]></dc:creator><pubDate>Wed, 06 Nov 2019 08:02:24 GMT</pubDate></item></channel></rss>