Skip to main content

python library to use the Adafruit NXP 9-Dof IMU

Project description

https://raw.githubusercontent.com/MomsFriendlyRobotCompany/nxp_imu/master/docs/pics/imu-iso.jpg

NXP IMU

https://img.shields.io/pypi/l/nxp_imu.svg https://img.shields.io/pypi/pyversions/nxp_imu.svg https://img.shields.io/pypi/wheel/nxp_imu.svg https://img.shields.io/pypi/v/nxp_imu.svg https://travis-ci.org/MomsFriendlyRobotCompany/nxp_imu.svg?branch=master

Python drivers for Adafruit Precision NXP 9-DOF. This is basically a python version of Adafruit’s FXOS8700 and their FXAS21002C written in C++ for the Arduino.

NXP Precision 9DoF

The board consists of two separate ICs, described below:

FXOS8700 3-Axis Accelerometer/Magnetometer

  • 2-3.6V Supply

  • ±2 g/±4 g/±8 g adjustable acceleration range

  • ±1200 µT magnetic sensor range

  • Output data rates (ODR) from 1.563 Hz to 800 Hz

  • 14-bit ADC resolution for acceleration measurements

  • 16-bit ADC resolution for magnetic measurements

FXAS21002 3-Axis Gyroscope

  • 2-3.6V Supply

  • ±250/500/1000/2000°/s configurable range

  • Output Data Rates (ODR) from 12.5 to 800 Hz

  • 16-bit digital output resolution

  • 192 bytes FIFO buffer (32 X/Y/Z samples)

Setup

https://raw.githubusercontent.com/MomsFriendlyRobotCompany/nxp_imu/master/docs/pics/imu-front.jpg
https://raw.githubusercontent.com/MomsFriendlyRobotCompany/nxp_imu/master/docs/pics/imu-back.jpg

Adafruit setup tutorial

Usage

See the examples folder, but to have the IMU run at 4G and 2000 degrees per second:

#!/usr/bin/env python

from __future__ import division, print_function
from nxp_imu import IMU
import time

imu = IMU(gs=4, dps=2000, verbose=True)
header = 67
print('-'*header)
print("| {:17} | {:20} | {:20} |".format("Accels [g's]", " Magnet [uT]", "Gyros [dps]"))
print('-'*header)
for _ in range(10):
        a, m, g = imu.get()
        print('| {:>5.2f} {:>5.2f} {:>5.2f} | {:>6.1f} {:>6.1f} {:>6.1f} | {:>6.1f} {:>6.1f} {:>6.1f} |'.format(
                a[0], a[1], a[2],
                m[0], m[1], m[2],
                g[0], g[1], g[2])
        )
        time.sleep(0.50)
print('-'*header)
print(' uT: micro Tesla')
print('  g: gravity')
print('dps: degrees per second')
print('')

Documents

The /docs folder has the datasheets for both the accel/magnetometer and the gyros.

MIT License

Copyright (c) 2017 Kevin J. Walchko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nxp_imu-0.5.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distributions

nxp_imu-0.5.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

nxp_imu-0.5.0-py2-none-any.whl (12.3 kB view details)

Uploaded Python 2

File details

Details for the file nxp_imu-0.5.0.tar.gz.

File metadata

  • Download URL: nxp_imu-0.5.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nxp_imu-0.5.0.tar.gz
Algorithm Hash digest
SHA256 41527ec7c673886d164b329a7f71d227172a8723093d32cf4fad8f9a9e1fae5a
MD5 3937e71d65108ca8f3948d9882890a1d
BLAKE2b-256 d831a850dce86ea1bcb9e662418fa3dd9d0bcbbb91af0fb9b53648b2181672f3

See more details on using hashes here.

Provenance

File details

Details for the file nxp_imu-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nxp_imu-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66d741d2eb66be032a065487c7926ace17e274bbb9ae0cc797f0fe5fae303c91
MD5 96800c025ffbfdb7a918f053441627a4
BLAKE2b-256 7d8866a4b979a12347c03eabde17ea5f48cfd014fb758ba7aa864e60ca6bd537

See more details on using hashes here.

Provenance

File details

Details for the file nxp_imu-0.5.0-py2-none-any.whl.

File metadata

File hashes

Hashes for nxp_imu-0.5.0-py2-none-any.whl
Algorithm Hash digest
SHA256 398154dc41bac6dbbcb9102bf855e5f9dd686ba40270e4fd37ad72397ab6926c
MD5 64f3f38f0b6eb99e10bc45da5836e540
BLAKE2b-256 1f6e346475e4ec06a4ca25f7600e0f30a183534e9fe2d6afc62b04fdd26a85c2

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page