Skip to content

Commit d72b75d

Browse files
committed
Wrap the call that enables pull-up for interrupt pin 1 in a try/except
This is useful in cases where there is no support for internal pull-up resistor on the board (for example Binho Nova host adapter). On such devices, one have to use an external pull-up resistor.
1 parent 6791d3f commit d72b75d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adafruit_lis3dh.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ def __init__(
129129
self._int2 = int2
130130
if self._int1:
131131
self._int1.direction = digitalio.Direction.INPUT
132-
self._int1.pull = digitalio.Pull.UP
132+
try:
133+
self._int1.pull = digitalio.Pull.UP
134+
except AttributeError:
135+
pass
133136

134137
@property
135138
def data_rate(

0 commit comments

Comments
 (0)