code.py
1 # SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries 2 # 3 # SPDX-License-Identifier: MIT 4 5 import time 6 import board 7 import adafruit_lis3dh 8 import busio 9 10 i2c = busio.I2C(board.ACCELEROMETER_SCL, board.ACCELEROMETER_SDA) 11 lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19) 12 lis3dh.range = adafruit_lis3dh.RANGE_8_G 13 14 while True: 15 x, y, z = lis3dh.acceleration 16 print((x, y, z)) 17 time.sleep(0.1)