Skip to content

Commit bb6ee16

Browse files
authored
Merge pull request #93 from ilario/Pin
Avoid error when microcontroller>Pin import fails
2 parents ec00ae4 + e12f9f4 commit bb6ee16

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adafruit_ads1x15/ads1x15.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
from busio import I2C
2626
from microcontroller import Pin
2727
except ImportError:
28-
pass
28+
# define Pin to avoid the error:
29+
# def read(self, pin: Pin, is_differential: bool = False) -> int:
30+
# NameError: name 'Pin' is not defined
31+
Pin = None
2932

3033
_ADS1X15_DEFAULT_ADDRESS = const(0x48)
3134
_ADS1X15_POINTER_CONVERSION = const(0x00)

0 commit comments

Comments
 (0)