We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca1a9b9 commit db918daCopy full SHA for db918da
1 file changed
docs/design_guide.rst
@@ -250,12 +250,13 @@ I2C Example
250
251
from adafruit_bus_device import i2c_device
252
253
+ DEVICE_DEFAULT_I2C_ADDR = 0x42
254
+
255
class Widget:
256
"""A generic widget."""
257
- def __init__(self, i2c):
- # Always on address 0x40.
258
- self.i2c_device = i2c_device.I2CDevice(i2c, 0x40)
+ def __init__(self, i2c, address=DEVICE_DEFAULT_I2C_ADDR):
259
+ self.i2c_device = i2c_device.I2CDevice(i2c, address)
260
self.buf = bytearray(1)
261
262
@property
0 commit comments