Re: Module for MPU9150
Posted: Sun Mar 12, 2017 11:58 am
Hey guys, i just got an MPU9150 sensor, and wanted to try out your lib. What i wanna do is simply read the accelerometer often (i would like to do it with a timer, but if you have any other suggestion then its welcome).
I upgraded my WiPy firmware as shown here: http://docs.micropython.org/en/latest/w ... er-the-air to 1.8.2
Downloaded the libary from here: https://github.com/micropython-IMU/micropython-mpu9x50
After that i copied mpu9150.py, vector3d.py and imu.py to the wipy. Opened a telnet to the wipy and tried the following:
http://puu.sh/uFoK8/72753ebf33.png
I can see the sensor, when i do the following:
the addr is 105, i have no idea what i'm doing wrong, could someone help me out? Even after that the mpu9150 module initialization is not very clear to me either. Its probably my bad tho, since i'm new to python, but i could really appreciate some help!
I upgraded my WiPy firmware as shown here: http://docs.micropython.org/en/latest/w ... er-the-air to 1.8.2
Downloaded the libary from here: https://github.com/micropython-IMU/micropython-mpu9x50
After that i copied mpu9150.py, vector3d.py and imu.py to the wipy. Opened a telnet to the wipy and tried the following:
http://puu.sh/uFoK8/72753ebf33.png
I can see the sensor, when i do the following:
Code: Select all
from machine import I2C
import os
def test():
mch = os.uname().machine
if 'LaunchPad' in mch:
i2c_pins = ('GP11', 'GP10')
elif 'WiPy' in mch:
i2c_pins = ('GP24', 'GP23')
else:
raise Exception('Board not supported!')
i2c = I2C(0, mode=I2C.MASTER, baudrate=400000, pins=i2c_pins)
addr = i2c.scan()
print(addr)