From 005d15979a3be537f46243a201a27251a2fa3d5d Mon Sep 17 00:00:00 2001 From: BiffoBear Date: Sun, 9 Feb 2020 15:29:57 +0300 Subject: [PATCH 1/2] initial commit -- renamed tap_detection.py --- examples/lsm303_accel_tap_detection.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/lsm303_accel_tap_detection.py diff --git a/examples/lsm303_accel_tap_detection.py b/examples/lsm303_accel_tap_detection.py new file mode 100644 index 0000000..ef2e326 --- /dev/null +++ b/examples/lsm303_accel_tap_detection.py @@ -0,0 +1,12 @@ +import board +import busio +import adafruit_lsm303_accel + +i2c = busio.I2C(board.SCL, board.SDA) +accel = adafruit_lsm303_accel.LSM303_Accel(i2c) +accel.range = adafruit_lsm303_accel.Range.RANGE_8G +accel.set_tap(1, 30) + +while True: + if accel.tapped: + print("Tapped!\n") From 32b1adbdb222cf1b644e2bda439f7b7888badcb2 Mon Sep 17 00:00:00 2001 From: BiffoBear Date: Sun, 9 Feb 2020 18:20:37 +0300 Subject: [PATCH 2/2] actually deleted the old file this time --- examples/tap_detection.py | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 examples/tap_detection.py diff --git a/examples/tap_detection.py b/examples/tap_detection.py deleted file mode 100644 index ef2e326..0000000 --- a/examples/tap_detection.py +++ /dev/null @@ -1,12 +0,0 @@ -import board -import busio -import adafruit_lsm303_accel - -i2c = busio.I2C(board.SCL, board.SDA) -accel = adafruit_lsm303_accel.LSM303_Accel(i2c) -accel.range = adafruit_lsm303_accel.Range.RANGE_8G -accel.set_tap(1, 30) - -while True: - if accel.tapped: - print("Tapped!\n")