Skip to content

Commit bea5d4a

Browse files
authored
Merge pull request #65 from caternuson/iss64
Update simpletest example
2 parents 3fbf837 + 3665a84 commit bea5d4a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

examples/lis3dh_simpletest.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
11
import time
22
import board
3-
import digitalio
43
import busio
54
import adafruit_lis3dh
65

76
# Hardware I2C setup. Use the CircuitPlayground built-in accelerometer if available;
87
# otherwise check I2C pins.
98
if hasattr(board, "ACCELEROMETER_SCL"):
109
i2c = busio.I2C(board.ACCELEROMETER_SCL, board.ACCELEROMETER_SDA)
11-
int1 = digitalio.DigitalInOut(board.ACCELEROMETER_INTERRUPT)
12-
lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19, int1=int1)
10+
lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19)
1311
else:
1412
i2c = busio.I2C(board.SCL, board.SDA)
15-
int1 = digitalio.DigitalInOut(board.D6) # Set to correct pin for interrupt!
16-
lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c, int1=int1)
13+
lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c)
1714

1815
# Hardware SPI setup:
1916
# spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
2017
# cs = digitalio.DigitalInOut(board.D5) # Set to correct CS pin!
21-
# int1 = digitalio.DigitalInOut(board.D6) # Set to correct pin for interrupt!
22-
# lis3dh = adafruit_lis3dh.LIS3DH_SPI(spi, cs, int1=int1)
18+
# lis3dh = adafruit_lis3dh.LIS3DH_SPI(spi, cs)
2319

2420
# PyGamer or MatrixPortal I2C Setup:
2521
# i2c = busio.I2C(board.SCL, board.SDA)
26-
# int1 = digitalio.DigitalInOut(board.ACCELEROMETER_INTERRUPT)
27-
# lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19, int1=int1)
22+
# lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19)
2823

2924

3025
# Set range of accelerometer (can be RANGE_2_G, RANGE_4_G, RANGE_8_G or RANGE_16_G).

0 commit comments

Comments
 (0)