Skip to content

Icm20948 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
522e57c
starting refactor
siddacious Mar 6, 2020
07262d0
both sensor working, ranges are wrong
siddacious Mar 6, 2020
b1ca88e
ranges scaling correctly
siddacious Mar 7, 2020
b8d1e90
almost there on mag, missing some bytes
siddacious Mar 7, 2020
ef70411
working!
siddacious Mar 10, 2020
26ea836
working tempermentally
siddacious Mar 10, 2020
d99533b
fixing timing issues, formatting
siddacious May 19, 2020
a1c65ca
fixing docs build
siddacious May 19, 2020
de78312
fixed scaling issues created by debugging code
siddacious May 25, 2020
e78cc5f
working, cleaned up
siddacious May 25, 2020
c18c3dd
black'd and linted
siddacious May 25, 2020
ace6db7
fixing merge leftovers
siddacious May 25, 2020
167e7be
renaming
siddacious May 26, 2020
0461f9b
refactoring to add retries/reset on mag setup
siddacious May 26, 2020
7d15be8
fixed :)
siddacious May 26, 2020
ae4bea2
Fix code block rendering
evaherrada May 26, 2020
5413a95
Replace ICM20649 with ICM20X
evaherrada May 26, 2020
a5e42f2
Added second example
evaherrada May 26, 2020
2fd26d3
Reverted docs badge change
evaherrada May 26, 2020
ce6322a
adding filters
siddacious May 26, 2020
52a561a
Merge remote-tracking branch 'adafruit/icm20948' into icm20948
siddacious May 26, 2020
8035854
adding low power flag
siddacious May 26, 2020
2aca353
reorganizing
siddacious May 26, 2020
82a66fc
added data rate property for mag
siddacious May 27, 2020
a0e05ce
updating examples and tested data rates
siddacious May 27, 2020
9e43fc2
hiding `low_power` for now
siddacious May 27, 2020
185855a
adding SparkFun callout
siddacious May 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.7.5
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Bryan Siepert for Adafruit Industries
Copyright (c) 2020 Bryan Siepert for Adafruit Industries

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
48 changes: 35 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Introduction
:target: https://discord.gg/nBQh6qu
:alt: Discord

.. image:: https://github.com/adafruit/Adafruit_CircuitPython_ICM20649/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_ICM20649/actions
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_ICM20X/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_ICM20X/actions
:alt: Build Status

Library for the ST ICM-20649 Wide-Range 6-DoF Accelerometer and Gyro
Library for the ST ICM-20X Wide-Range 6-DoF Accelerometer and Gyro Family


Dependencies
Expand All @@ -32,17 +32,17 @@ Installing from PyPI
=====================

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-icm20649/>`_. To install for current user:
PyPI <https://pypi.org/project/adafruit-circuitpython-icm20x/>`_. To install for current user:

.. code-block:: shell

pip3 install adafruit-circuitpython-icm20649
pip3 install adafruit-circuitpython-icm20x

To install system-wide (this may be required in some cases):

.. code-block:: shell

sudo pip3 install adafruit-circuitpython-icm20649
sudo pip3 install adafruit-circuitpython-icm20x

To install in a virtual environment in your current project:

Expand All @@ -51,31 +51,53 @@ To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install adafruit-circuitpython-icm20649
pip3 install adafruit-circuitpython-icm20x

Usage Example
=============

.. code-block: python3
For use with the ICM20649:

.. code-block:: python3

import time
import board
import busio
import adafruit_icm20x

i2c = busio.I2C(board.SCL, board.SDA)
icm = adafruit_icm20x.ICM20649(i2c)

while True:
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (icm.acceleration))
print("Gyro X:%.2f, Y: %.2f, Z: %.2f rads/s" % (icm.gyro))
print("")
time.sleep(0.5)

For use with the ICM20948:

.. code-block:: python3

import time
import board
import busio
import adafruit_icm20649
import adafruit_icm20x

i2c = busio.I2C(board.SCL, board.SDA)
icm = adafruit_icm20649.ICM20649(i2c)
icm = adafruit_icm20x.ICM20948(i2c)

while True:
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2"%(icm.acceleration))
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s"%(icm.gyro))
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (icm.acceleration))
print("Gyro X:%.2f, Y: %.2f, Z: %.2f rads/s" % (icm.gyro))
print("Magnetometer X:%.2f, Y: %.2f, Z: %.2f uT" % (icm.magnetic))
print("")
time.sleep(0.5)

Contributing
============

Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_ICM20649/blob/master/CODE_OF_CONDUCT.md>`_
<https://github.com/adafruit/Adafruit_CircuitPython_ICM20X/blob/master/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

Documentation
Expand Down
Loading