@@ -251,8 +251,8 @@ def __init__(self, i2c, address=_STMPE_ADDR):
251
251
Check the STMPE610 was founnd
252
252
Default address is 0x41 but another address can be passed in as an argument
253
253
"""
254
- import adafruit_bus_device .i2c_device as i2c_device
255
- self ._i2c = i2c_device .I2CDevice (i2c , address )
254
+ import adafruit_bus_device .i2c_device as i2cdev
255
+ self ._i2c = i2cdev .I2CDevice (i2c , address )
256
256
# Check device version.
257
257
version = self .get_version
258
258
if _STMPE_VERSION != version :
@@ -282,13 +282,13 @@ def __init__(self, spi, cs, baudrate=1000000):
282
282
"""
283
283
Check the STMPE610 was found,Default clock rate 1000000 - can be changed with 'baudrate'
284
284
"""
285
- import adafruit_bus_device .spi_device as spi_device
286
- self ._spi = spi_device .SPIDevice (spi , cs , baudrate = baudrate )
285
+ import adafruit_bus_device .spi_device as spidev
286
+ self ._spi = spidev .SPIDevice (spi , cs , baudrate = baudrate )
287
287
# Check device version.
288
288
version = self .get_version
289
289
if _STMPE_VERSION != version :
290
290
# if it fails try SPI MODE 1 -- that is what Arduino does
291
- self ._spi = spi_device .SPIDevice (spi , cs , baudrate = baudrate , polarity = 0 , phase = 1 )
291
+ self ._spi = spidev .SPIDevice (spi , cs , baudrate = baudrate , polarity = 0 , phase = 1 )
292
292
version = self .get_version
293
293
if _STMPE_VERSION != version :
294
294
raise RuntimeError ('Failed to find STMPE610! Chip Version 0x%x' % version )
0 commit comments