Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add I2C address #62

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions adafruit_pn532/i2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@
class PN532_I2C(PN532):
"""Driver for the PN532 connected over I2C."""

def __init__(self, i2c, *, irq=None, reset=None, req=None, debug=False):
def __init__(
self, i2c, address=_I2C_ADDRESS, *, irq=None, reset=None, req=None, debug=False
):
"""Create an instance of the PN532 class using I2C. Note that PN532
uses clock stretching. Optional IRQ pin (not used),
resetp pin and debugging output.
"""
self.debug = debug
self._req = req
self._i2c = i2c_device.I2CDevice(i2c, _I2C_ADDRESS)
self._i2c = i2c_device.I2CDevice(i2c, address)
super().__init__(debug=debug, irq=irq, reset=reset)

def _wakeup(self):
Expand Down