@@ -9,11 +9,11 @@ Introduction
9
9
:target: https://discord.gg/nBQh6qu
10
10
:alt: Discord
11
11
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
14
14
:alt: Build Status
15
15
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
17
17
18
18
19
19
Dependencies
@@ -32,17 +32,17 @@ Installing from PyPI
32
32
=====================
33
33
34
34
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:
36
36
37
37
.. code-block :: shell
38
38
39
- pip3 install adafruit-circuitpython-icm20649
39
+ pip3 install adafruit-circuitpython-icm20x
40
40
41
41
To install system-wide (this may be required in some cases):
42
42
43
43
.. code-block :: shell
44
44
45
- sudo pip3 install adafruit-circuitpython-icm20649
45
+ sudo pip3 install adafruit-circuitpython-icm20x
46
46
47
47
To install in a virtual environment in your current project:
48
48
@@ -51,31 +51,53 @@ To install in a virtual environment in your current project:
51
51
mkdir project-name && cd project-name
52
52
python3 -m venv .env
53
53
source .env/bin/activate
54
- pip3 install adafruit-circuitpython-icm20649
54
+ pip3 install adafruit-circuitpython-icm20x
55
55
56
56
Usage Example
57
57
=============
58
58
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
+
60
81
import time
61
82
import board
62
83
import busio
63
- import adafruit_icm20649
84
+ import adafruit_icm20x
64
85
65
86
i2c = busio.I2C(board.SCL, board.SDA)
66
- icm = adafruit_icm20649.ICM20649 (i2c)
87
+ icm = adafruit_icm20x.ICM20948 (i2c)
67
88
68
89
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))
71
93
print("")
72
94
time.sleep(0.5)
73
95
74
96
Contributing
75
97
============
76
98
77
99
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> `_
79
101
before contributing to help this project stay welcoming.
80
102
81
103
Documentation
0 commit comments