CircuitPython library for LSM9DS0 accelerometer, magnetometer, gyroscope.
Project description
Introduction
CircuitPython module for the LSM9DS0 accelerometer, magnetometer, gyroscope.
Dependencies
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.
Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install adafruit-circuitpython-lsm9ds0
To install system-wide (this may be required in some cases):
sudo pip3 install adafruit-circuitpython-lsm9ds0
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-lsm9ds0
Usage Example
import time
import board
import busioimport adafruit_lsm9ds0
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_lsm9ds0.LSM9DS0_I2C(i2c)
while True:
accel_x, accel_y, accel_z = sensor.acceleration
mag_x, mag_y, mag_z = sensor.magnetic
gyro_x, gyro_y, gyro_z = sensor.gyro
temp = sensor.temperature
print('Acceleration (m/s^2): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(accel_x, accel_y, accel_z))
print('Magnetometer (gauss): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(mag_x, mag_y, mag_z))
print('Gyroscope (degrees/sec): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(gyro_x, gyro_y, gyro_z))
print('Temperature: {0:0.3f}C'.format(temp))
time.sleep(1.0)
Documentation
API documentation for this library can be found on Read the Docs.
For information on building library documentation, please check out this guide.
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file adafruit-circuitpython-lsm9ds0-2.2.15.tar.gz
.
File metadata
- Download URL: adafruit-circuitpython-lsm9ds0-2.2.15.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7131e520ab2f41f7b0c9dcec1a33e24f0d4053b35e2dd63f09093a3cafe58b9 |
|
MD5 | 7d33b8856a1bd91e46abfff7a63e46e0 |
|
BLAKE2b-256 | e2e738c48cc97cb1423cf5c72b56a3d4982a88a9db2a01ae2eb8069844f093eb |
File details
Details for the file adafruit_circuitpython_lsm9ds0-2.2.15-py3-none-any.whl
.
File metadata
- Download URL: adafruit_circuitpython_lsm9ds0-2.2.15-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb4e1d38bcf152c2b614390086ff554f139987480fef548bb11f002ea4b9e898 |
|
MD5 | bd69b2405b20d652b156a745fd469696 |
|
BLAKE2b-256 | 34fb9827c5cf36d5ff2844b1e26f92c5cb59b197c351614d2bcfdd3080c3f87a |