Skip to content

Commit 01f833b

Browse files
authored
Merge pull request #7 from adafruit/icm20948
Icm20948
2 parents df149fb + 185855a commit 01f833b

16 files changed

+908
-381
lines changed

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.7.5

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2019 Bryan Siepert for Adafruit Industries
3+
Copyright (c) 2020 Bryan Siepert for Adafruit Industries
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.rst

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ Introduction
99
:target: https://discord.gg/nBQh6qu
1010
:alt: Discord
1111

12-
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_ICM20649/workflows/Build%20CI/badge.svg
13-
:target: https://github.com/adafruit/Adafruit_CircuitPython_ICM20649/actions
12+
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_ICM20X/workflows/Build%20CI/badge.svg
13+
:target: https://github.com/adafruit/Adafruit_CircuitPython_ICM20X/actions
1414
:alt: Build Status
1515

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

1818

1919
Dependencies
@@ -32,17 +32,17 @@ Installing from PyPI
3232
=====================
3333

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

3737
.. code-block:: shell
3838
39-
pip3 install adafruit-circuitpython-icm20649
39+
pip3 install adafruit-circuitpython-icm20x
4040
4141
To install system-wide (this may be required in some cases):
4242

4343
.. code-block:: shell
4444
45-
sudo pip3 install adafruit-circuitpython-icm20649
45+
sudo pip3 install adafruit-circuitpython-icm20x
4646
4747
To install in a virtual environment in your current project:
4848

@@ -51,31 +51,53 @@ To install in a virtual environment in your current project:
5151
mkdir project-name && cd project-name
5252
python3 -m venv .env
5353
source .env/bin/activate
54-
pip3 install adafruit-circuitpython-icm20649
54+
pip3 install adafruit-circuitpython-icm20x
5555
5656
Usage Example
5757
=============
5858

59-
.. code-block: python3
59+
For use with the ICM20649:
60+
61+
.. code-block:: python3
62+
63+
import time
64+
import board
65+
import busio
66+
import adafruit_icm20x
67+
68+
i2c = busio.I2C(board.SCL, board.SDA)
69+
icm = adafruit_icm20x.ICM20649(i2c)
70+
71+
while True:
72+
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (icm.acceleration))
73+
print("Gyro X:%.2f, Y: %.2f, Z: %.2f rads/s" % (icm.gyro))
74+
print("")
75+
time.sleep(0.5)
76+
77+
For use with the ICM20948:
78+
79+
.. code-block:: python3
80+
6081
import time
6182
import board
6283
import busio
63-
import adafruit_icm20649
84+
import adafruit_icm20x
6485
6586
i2c = busio.I2C(board.SCL, board.SDA)
66-
icm = adafruit_icm20649.ICM20649(i2c)
87+
icm = adafruit_icm20x.ICM20948(i2c)
6788
6889
while True:
69-
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2"%(icm.acceleration))
70-
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s"%(icm.gyro))
90+
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (icm.acceleration))
91+
print("Gyro X:%.2f, Y: %.2f, Z: %.2f rads/s" % (icm.gyro))
92+
print("Magnetometer X:%.2f, Y: %.2f, Z: %.2f uT" % (icm.magnetic))
7193
print("")
7294
time.sleep(0.5)
7395
7496
Contributing
7597
============
7698

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

81103
Documentation

0 commit comments

Comments
 (0)