python library to use the Adafruit NXP 9-Dof IMU
Project description
NXP IMU
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
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
Built Distributions
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41527ec7c673886d164b329a7f71d227172a8723093d32cf4fad8f9a9e1fae5a |
|
MD5 | 3937e71d65108ca8f3948d9882890a1d |
|
BLAKE2b-256 | d831a850dce86ea1bcb9e662418fa3dd9d0bcbbb91af0fb9b53648b2181672f3 |
Provenance
File details
Details for the file nxp_imu-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: nxp_imu-0.5.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d741d2eb66be032a065487c7926ace17e274bbb9ae0cc797f0fe5fae303c91 |
|
MD5 | 96800c025ffbfdb7a918f053441627a4 |
|
BLAKE2b-256 | 7d8866a4b979a12347c03eabde17ea5f48cfd014fb758ba7aa864e60ca6bd537 |
Provenance
File details
Details for the file nxp_imu-0.5.0-py2-none-any.whl
.
File metadata
- Download URL: nxp_imu-0.5.0-py2-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 398154dc41bac6dbbcb9102bf855e5f9dd686ba40270e4fd37ad72397ab6926c |
|
MD5 | 64f3f38f0b6eb99e10bc45da5836e540 |
|
BLAKE2b-256 | 1f6e346475e4ec06a4ca25f7600e0f30a183534e9fe2d6afc62b04fdd26a85c2 |