lsm6dsox_basic.py

# Ce travail est publié sous licence MIT.
# Copyright (c) 2013-2023 OpenMV LLC. Tous droits réservés.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# Exemple de base LSM6DSOX.
import time
from lsm6dsox import LSM6DSOX
from machine import Pin
from machine import I2C

lsm = LSM6DSOX(I2C(0, scl=Pin(13), sda=Pin(12)))
# Ou initialiser en mode SPI.
# lsm = LSM6DSOX(SPI(5), cs=Pin(10))

while True:
    print("Accelerometer: x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}".format(*lsm.accel()))
    print("Gyroscope:     x:{:>8.3f} y:{:>8.3f} z:{:>8.3f}".format(*lsm.gyro()))
    print("")
    time.sleep_ms(100)

results matching ""

    No results matching ""