Skip to content

Commit b1f9cb1

Browse files
author
Noel Gaetan
committed
Create lsm6ds_lsm6ds3_simpletest.py
1 parent 3bc79ac commit b1f9cb1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

examples/lsm6ds_lsm6ds3_simpletest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2020 Bryan Siepert for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
import time
5+
import board
6+
from adafruit_lsm6ds.lsm6ds3 import LSM6DS3
7+
8+
i2c = board.I2C() # uses board.SCL and board.SDA
9+
sensor = LSM6DS33(i2c)
10+
11+
while True:
12+
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (sensor.acceleration))
13+
print("Gyro X:%.2f, Y: %.2f, Z: %.2f radians/s" % (sensor.gyro))
14+
print("")
15+
time.sleep(0.5)

0 commit comments

Comments
 (0)