Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 68dd305

Browse files
committed
small i2c change
1 parent d4cc5fd commit 68dd305

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Adafruit_GPIO/I2C.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_default_bus():
5656
else:
5757
raise RuntimeError('Could not determine default I2C bus for platform.')
5858

59-
def get_i2c_device(address, busnum=None, i2c_interface=None, **kwargs):
59+
def get_i2c_device(address, busnum=8, i2c_interface=None, **kwargs):
6060
"""Return an I2C device for the specified address and on the specified bus.
6161
If busnum isn't specified, the default I2C bus for the platform will attempt
6262
to be detected.
@@ -95,8 +95,8 @@ def __init__(self, address, busnum, i2c_interface=None):
9595
self._address = address
9696
if i2c_interface is None:
9797
# Use pure python I2C interface if none is specified.
98-
import Adafruit_PureIO.smbus
99-
self._bus = Adafruit_PureIO.smbus.SMBus(busnum)
98+
import smbus
99+
self._bus = smbus.SMBus(busnum)
100100
else:
101101
# Otherwise use the provided class to create an smbus interface.
102102
self._bus = i2c_interface(busnum)

0 commit comments

Comments
 (0)