-
Notifications
You must be signed in to change notification settings - Fork 20
Added shake detection #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this! Two minor things.
adafruit_lis3dh/lis3dh.py
Outdated
anything less than 10 will erroneously report a constant | ||
shake detected. (Default 30) | ||
avg_delay - The speed in seconds at which the series of values used for the | ||
average acceleration are taken. (Default 0.01) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be clearer if this was total delay. That way its easy to tell how long it will take. Then, in the sleep just divide total delay by the number of samples.
adafruit_lis3dh/lis3dh.py
Outdated
""" | ||
shake_accel = (0, 0, 0) | ||
for i in range(avg_count): | ||
shake_accel = tuple(map(sum, zip(shake_accel, self.acceleration))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty tricky. How about adding a comment explaining how it works.
readings from acceleration. (Default 0.1) | ||
""" | ||
shake_accel = (0, 0, 0) | ||
for i in range(avg_count): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the internal explanation here after a #. The """ comment should only have the "public" info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you thank you!
Updating https://github.com/adafruit/Adafruit_CircuitPython_DotStar to 1.1.3 from 1.1.2: > Add build tools into the requirements. > Configure Travis builds using circuitpython build tools. > Added import math > Updated neopixels to dostars in doc Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH to v1.0.0 from 0.1.3: > Added shake detection (adafruit/Adafruit_CircuitPython_LIS3DH#13)
No description provided.