On Wed, 3 Oct 2018 20:15:04 -0700 (PDT), Chris Bohler
<
chris....@sbcglobal.net> declaimed the
following:
>
>When attempt to execute Adafruit_BBIO.I2C as I2C:
> "Adafruit_BBIO.I2C deprecated. Replace with Adafruit_GPIO.I2C"
>
Note the message says "deprecated", not that it is no longer usable.
> File
>"/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.3-py2.7.egg/Adafruit_GPIO/I2C.py",
>line 98, in __init__
> import Adafruit_PureIO.smbus
>ImportError: No module named Adafruit_PureIO.smbus
>
Looking at the source code for I2C
"""
def __init__(self, address, busnum, i2c_interface=None):
"""Create an instance of the I2C device at the specified address on
the
specified I2C bus number."""
self._address = address
if i2c_interface is None:
# Use pure python I2C interface if none is specified.
import Adafruit_PureIO.smbus
self._bus = Adafruit_PureIO.smbus.SMBus(busnum)
else:
# Otherwise use the provided class to create an smbus
interface.
self._bus = i2c_interface(busnum)
"""
you can bypass Adafruit_PureIO by providing your own interface object. I
have not looked deeper into what such an object would be.
>This from simple python code:
>
>import Adafruit_GPIO.I2C as I2C
>import Adafruit_BBIO.GPIO as GPIO
I suspect if you are using Adafruit_GPIO you should also use
import Adafruit_GPIO.GPIO as GPIO
(that, itself, imports Adafruit_BBIO)
--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/