Skip to content

Commit

Permalink
Merge pull request #93 from ilario/Pin
Browse files Browse the repository at this point in the history
Avoid error when microcontroller>Pin import fails
  • Loading branch information
FoamyGuy authored Oct 23, 2023
2 parents ec00ae4 + e12f9f4 commit bb6ee16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adafruit_ads1x15/ads1x15.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
from busio import I2C
from microcontroller import Pin
except ImportError:
pass
# define Pin to avoid the error:
# def read(self, pin: Pin, is_differential: bool = False) -> int:
# NameError: name 'Pin' is not defined
Pin = None

_ADS1X15_DEFAULT_ADDRESS = const(0x48)
_ADS1X15_POINTER_CONVERSION = const(0x00)
Expand Down

0 comments on commit bb6ee16

Please sign in to comment.