Skip to content

Added error to cpx.shake for incompatible CircuitPython versions #19

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

Merged
merged 2 commits into from
Dec 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions adafruit_circuitplayground/express.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,11 @@ def shake(self):
if cpx.shake(shake_threshold=20):
print("Shake detected more easily than before!")
"""
return self._lis3dh.shake()

try:
return self._lis3dh.shake()
except AttributeError:
raise RuntimeError("Oops! You need a newer version of CircuitPython "
"(2.2.0 or greater) to use cpx.shake.")

@property
def touch_A1(self): # pylint: disable=invalid-name
Expand Down