GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - SpaceBarrr/CircuitPython_LSM6DSV16X: CircuitPython helper library for the LSM6DSV16X, based off the Adafruit LSM6DS library.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

202 Commits
202 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
LICENSES
LICENSES
 
 
docs
docs
 
 
examples
examples
 
 
lsm6dsv16x
lsm6dsv16x
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.pylintrc
.pylintrc
 
 
.readthedocs.yaml
.readthedocs.yaml
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE
LICENSE
 
 
README.rst
README.rst
 
 
README.rst.license
README.rst.license
 
 
optional_requirements.txt
optional_requirements.txt
 
 
pyproject.toml
pyproject.toml
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

CircuitPython LSM6DSV16X

This fork was created to implement the LSM6DSV16X 6DoF IMU from STM. It implements acceleration and gyro data, as well as sensor fusion between the two. PRs to implement the remaining features are welcome.

Backwards compatability with other LSM6DS family sensors implemented in the original Adafruit library has not been tested, and is likely broken.

The LSM6DSV16X is not currently an Adafruit product.

Installation

Using pip3 install adafruit-circuitpython-lsm6ds will install the original Adafruit library, and which currently does not support the LSM6DSV16X. You must clone this repo as a submodule into your project.

git submodule add https://github.com/SpaceBarrr/Adafruit_CircuitPython_LSM6DS
git submodule update --init

Dependencies are the same as the original Adafruit library. This driver depends on:

  • Adafruit CircuitPython
  • Bus Device
  • Register

Usage

By default, sensor fusion is enabled. You can access the fused data through the quaternion property. However, you must set the values to be batched and then re-init.

import time
import board

from lsm6dsv16x import LSM6DSV16X

i2c = board.I2C()  # uses board.SCL and board.SDA
sensor: LSM6DSV16X = LSM6DSV16X(i2c, sensor_fusion=True)
sensor.fifo_mode = FIFOMode.CONTINUOUS_WTM_TO_FULL_MODE
sensor.fifo_watermark = 1
sensor.sflp_game_vec_batch = True
sensor.sflp_gravity_vec_batch = False
sensor.sflp_g_bias_batch = False
sensor.sflp_init = True

while True:
    print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (sensor.acceleration))
    print("Gyro X:%.2f, Y: %.2f, Z: %.2f radians/s" % (sensor.gyro))
    print(f"Temp: {sensor.temperature}")
    print(f"Quaternion: {sensor.quaternion}")
    time.sleep(0.5)

Documentation

API documentation for the original library can be found on Read the Docs.

Additional features were implemented based off the LSM6DSV16X datasheet and the example C code repository.

About

CircuitPython helper library for the LSM6DSV16X, based off the Adafruit LSM6DS library.

Resources

Readme
License

Code of conduct

Code of conduct
Activity

Stars

1 star

Watchers

0 watching

Forks

1 fork
Report repository

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.