User Tools

Site Tools


raspberrypi:mpu9250

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
raspberrypi:mpu9250 [2017/04/01 23:43] – created aistisraspberrypi:mpu9250 [2017/04/01 23:45] (current) – aistis
Line 1: Line 1:
-girsokopas, akselorometras ir kompasas MPU9250. ir dar kartu su barometru ir termometru  GY-91+girsokopas, akselorometras ir kompasas MPU9250. ir dar kartu su barometru ir termometru BMP280 
 + 
 +viskas sudeta viename modulyje:  GY-91
  
 {{:raspberrypi:pasted:20170401-234328.png}} {{:raspberrypi:pasted:20170401-234328.png}}
 +
 +https://github.com/FaBoPlatform/FaBo9AXIS-MPU9250-Python
 +
 +  pip install FaBo9Axis_MPU9250
 +
 +
 +<code python>
 +# coding: utf-8
 +## @package faboMPU9250
 +#  This is a library for the FaBo 9AXIS I2C Brick.
 +#
 +#  http://fabo.io/202.html
 +#
 +#  Released under APACHE LICENSE, VERSION 2.0
 +#
 +#  http://www.apache.org/licenses/
 +#
 +#  FaBo <[email protected]>
 +
 +import FaBo9Axis_MPU9250
 +import time
 +import sys
 +import os
 +
 +mpu9250 = FaBo9Axis_MPU9250.MPU9250()
 +
 +try:
 +    while True:
 +        os.system('clear')
 +
 +        accel = mpu9250.readAccel()
 +        print " ax = " , ( accel['x'] )
 +        print " ay = " , ( accel['y'] )
 +        print " az = " , ( accel['z'] )
 +
 +        gyro = mpu9250.readGyro()
 +        print " gx = " , ( gyro['x'] )
 +        print " gy = " , ( gyro['y'] )
 +        print " gz = " , ( gyro['z'] )
 +
 +        mag = mpu9250.readMagnet()
 +        print " mx = " , ( mag['x'] )
 +        print " my = " , ( mag['y'] )
 +        print " mz = " , ( mag['z'] )
 +        print
 +
 +        time.sleep(0.2)
 +
 +except KeyboardInterrupt:
 +    sys.exit()
 +</code>
raspberrypi/mpu9250.1491079409.txt.gz · Last modified: by aistis