Conversation
FoamyGuy
approved these changes
Jan 6, 2026
Contributor
FoamyGuy
left a comment
There was a problem hiding this comment.
This looks good to me. I tested this successfully on a MagTag 10.1.0-beta.1
I had to use the alternate I2C address. I confirmed the shake example doesn't trigger as expected with current code and does with the updated code.
This library is frozen in to MagTag and perhaps others that have one built-in so ultimately it will need updated in the core before these devices see benefits without putting the library in alternate root location.
adafruit-adabot
pushed a commit
to adafruit/Adafruit_CircuitPython_Bundle
that referenced
this pull request
Jan 7, 2026
Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH to 5.2.8 from 5.2.7: > Merge pull request adafruit/Adafruit_CircuitPython_LIS3DH#82 from caternuson/iss78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Possible fix for #78.
This fixes the math logic in
shake()and replaces the uberpythonic tuple/map/sum/zip approach with more simple code.A new example
lis3dh_shake.pyis also added.The default threshold has been reduced to
20since30required fairly aggressive shaking.Is the simple code less performant? Simple performance check:
With existing
shake()method:With PR
shake()method:Note that
0.1secs worth of this delay is part of the averaging delay in theshake()method. But TLDR = no significant difference in performance.