From 13eebfda7e85bf5304341f03cd6ac03ba705a947 Mon Sep 17 00:00:00 2001 From: caternuson Date: Thu, 23 Feb 2023 11:29:33 -0800 Subject: [PATCH] add i2c address --- adafruit_pn532/i2c.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/adafruit_pn532/i2c.py b/adafruit_pn532/i2c.py index ff36b3e..db4059d 100644 --- a/adafruit_pn532/i2c.py +++ b/adafruit_pn532/i2c.py @@ -29,14 +29,16 @@ _I2C_ADDRESS = const(0x24) 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):