From d72b75d62db937b17e12f7ddd31e5ec556e61b70 Mon Sep 17 00:00:00 2001 From: Per Thomas Jahr Date: Sun, 13 Aug 2023 10:25:29 +0200 Subject: [PATCH] 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. --- adafruit_lis3dh.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adafruit_lis3dh.py b/adafruit_lis3dh.py index 0544077..491d569 100755 --- a/adafruit_lis3dh.py +++ b/adafruit_lis3dh.py @@ -129,7 +129,10 @@ def __init__( self._int2 = int2 if self._int1: self._int1.direction = digitalio.Direction.INPUT - self._int1.pull = digitalio.Pull.UP + try: + self._int1.pull = digitalio.Pull.UP + except AttributeError: + pass @property def data_rate(