Skip to content

Commit 005d159

Browse files
author
BiffoBear
committed
initial commit -- renamed tap_detection.py
1 parent 5cba278 commit 005d159

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import board
2+
import busio
3+
import adafruit_lsm303_accel
4+
5+
i2c = busio.I2C(board.SCL, board.SDA)
6+
accel = adafruit_lsm303_accel.LSM303_Accel(i2c)
7+
accel.range = adafruit_lsm303_accel.Range.RANGE_8G
8+
accel.set_tap(1, 30)
9+
10+
while True:
11+
if accel.tapped:
12+
print("Tapped!\n")

0 commit comments

Comments
 (0)