I2C driver for LIS2HH12 3-axis accelerometer

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
User avatar
tuupola
Posts: 43
Joined: Sun Sep 17, 2017 12:10 am

I2C driver for LIS2HH12 3-axis accelerometer

Post by tuupola » Mon Oct 02, 2017 7:37 pm

MicroPython I2C driver for STMicroelectronics LIS2HH12 3-axis accelerometer. This chip is also found in PySense and PyTrack boards. However unlike the Pycom driver this one has permissive MIT license.

User avatar
tuupola
Posts: 43
Joined: Sun Sep 17, 2017 12:10 am

Re: I2C driver for LIS2HH12 3-axis accelerometer

Post by tuupola » Sun Feb 11, 2018 3:11 pm

Since I am big believer in reuseable code I just updated this driver to use unified sensor properties and units as described by CircuitPython design guide. TL;DR default unit is m/s^2 instead of g and values are accessed via sensor.acceleration property instead of sensor.acceleration() method.
Last edited by tuupola on Mon Feb 12, 2018 3:39 am, edited 1 time in total.

mattyt
Posts: 53
Joined: Mon Jan 23, 2017 6:39 am

Re: I2C driver for LIS2HH12 3-axis accelerometer

Post by mattyt » Mon Feb 12, 2018 12:21 am

Nice, I've just bought an LIS2DH12 which looks drop-in compatible. I'll give your code a try when I receive my device!

User avatar
tuupola
Posts: 43
Joined: Sun Sep 17, 2017 12:10 am

Re: I2C driver for LIS2HH12 3-axis accelerometer

Post by tuupola » Mon Feb 12, 2018 4:58 am

Let me know how it goes. If it works I mention it in docs.

Post Reply