raspberrypi:mpu9250
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| raspberrypi:mpu9250 [2017/04/01 23:43] – created aistis | raspberrypi:mpu9250 [2017/04/01 23:45] (current) – aistis | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | girsokopas, akselorometras ir kompasas MPU9250. ir dar kartu su barometru ir termometru | + | girsokopas, akselorometras ir kompasas MPU9250. ir dar kartu su barometru ir termometru |
| + | |||
| + | viskas sudeta viename modulyje: | ||
| {{: | {{: | ||
| + | |||
| + | https:// | ||
| + | |||
| + | pip install FaBo9Axis_MPU9250 | ||
| + | |||
| + | |||
| + | <code python> | ||
| + | # coding: utf-8 | ||
| + | ## @package faboMPU9250 | ||
| + | # This is a library for the FaBo 9AXIS I2C Brick. | ||
| + | # | ||
| + | # http:// | ||
| + | # | ||
| + | # Released under APACHE LICENSE, VERSION 2.0 | ||
| + | # | ||
| + | # http:// | ||
| + | # | ||
| + | # FaBo < | ||
| + | |||
| + | import FaBo9Axis_MPU9250 | ||
| + | import time | ||
| + | import sys | ||
| + | import os | ||
| + | |||
| + | mpu9250 = FaBo9Axis_MPU9250.MPU9250() | ||
| + | |||
| + | try: | ||
| + | while True: | ||
| + | os.system(' | ||
| + | |||
| + | accel = mpu9250.readAccel() | ||
| + | print " ax = " , ( accel[' | ||
| + | print " ay = " , ( accel[' | ||
| + | print " az = " , ( accel[' | ||
| + | |||
| + | gyro = mpu9250.readGyro() | ||
| + | print " gx = " , ( gyro[' | ||
| + | print " gy = " , ( gyro[' | ||
| + | print " gz = " , ( gyro[' | ||
| + | |||
| + | mag = mpu9250.readMagnet() | ||
| + | print " mx = " , ( mag[' | ||
| + | print " my = " , ( mag[' | ||
| + | print " mz = " , ( mag[' | ||
| + | |||
| + | |||
| + | time.sleep(0.2) | ||
| + | |||
| + | except KeyboardInterrupt: | ||
| + | sys.exit() | ||
| + | </ | ||
raspberrypi/mpu9250.1491079409.txt.gz · Last modified: by aistis
