We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2094d11 + 02d61bf commit 8545a49Copy full SHA for 8545a49
examples/lis3mdl_lsm6ds_test.py
@@ -0,0 +1,23 @@
1
+import time
2
+import board
3
+from adafruit_lsm6ds import LSM6DSOX as LSM6DS
4
+
5
+# To use LSM6DS33, comment out the previous line
6
+# and uncomment the next line
7
+# from adafruit_lsm6ds import LSM6DS33 as LSM6DS
8
+from adafruit_lis3mdl import LIS3MDL
9
10
+accel_gyro = LSM6DS(board.I2C())
11
+mag = LIS3MDL(board.I2C())
12
13
+while True:
14
+ acceleration = accel_gyro.acceleration
15
+ gyro = accel_gyro.gyro
16
+ magnetic = mag.magnetic
17
+ print(
18
+ "Acceleration: X:{0:7.2f}, Y:{1:7.2f}, Z:{2:7.2f} m/s^2".format(*acceleration)
19
+ )
20
+ print("Gyro X:{0:7.2f}, Y:{1:7.2f}, Z:{2:7.2f} rad/s".format(*gyro))
21
+ print("Magnetic X:{0:7.2f}, Y:{1:7.2f}, Z:{2:7.2f} uT".format(*magnetic))
22
+ print("")
23
+ time.sleep(0.5)
0 commit comments