mattdy / python-lis3dh Goto Github PK
View Code? Open in Web Editor NEWPython library for using a LIS3DH triple-axis accelerometer on a Raspberry Pi
License: MIT License
Python library for using a LIS3DH triple-axis accelerometer on a Raspberry Pi
License: MIT License
Hi Matt,
great work! It helped me a lot!
But unfortunately there are small issues with the new restructured gpio/i2c libs from Adafruit.
There were 3 changes required to get it working for me:
in file LIS3DH.py:
a) line15: The import must be changed from from Adafruit_I2C import Adafruit_I2C
to import Adafruid_GPIO.I2C as I2C
b) line 94: further the instanciaton from self.i2c = Adafruit_I2C(address, busnum=bus)
to self.i2c = I2C.Device(address, busnum=bus)
in file testLIS3DH.py
c) line 16: the init of the sensor object need the bus number: sensor = LIS3DH(debug=True)
to sensor = LIS3DH(bus=1,debug=True)
Thank you!
Best Regards
Michael
The LIS3DH allows for the 'interrupt' (INT) pin to be set high according to a set of given parameters, functionality to set and make use of this is not currently exposed in this library.
Adafruit has deprecated the Adafruit_Python_GPIO library (see https://github.com/adafruit/Adafruit_Python_GPIO) in favour of 'blinka' (https://github.com/adafruit/Adafruit_Blinka), which allows to use their full-fledged CircuitPython code for the sensor (https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH).
The blinka library is exclusively for Python 3, so if you need a Python 2 compatible library for the sensor, this library here might still be useful. (I recently switched to using the CircuitPython library and it works perfectly.)
I want to thank @mattdy for providing this, it helped me a lot in the past few years!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.