Skip to content

Commit

Permalink
Merge pull request #5 from jerryneedell/jerryn_fixpylint
Browse files Browse the repository at this point in the history
 fix pylint issue
  • Loading branch information
sommersoft committed Jul 18, 2018
2 parents 60b73ff + 352a6d7 commit 4930878
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions adafruit_stmpe610.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ def __init__(self, i2c, address=_STMPE_ADDR):
Check the STMPE610 was founnd
Default address is 0x41 but another address can be passed in as an argument
"""
import adafruit_bus_device.i2c_device as i2c_device
self._i2c = i2c_device.I2CDevice(i2c, address)
import adafruit_bus_device.i2c_device as i2cdev
self._i2c = i2cdev.I2CDevice(i2c, address)
# Check device version.
version = self.get_version
if _STMPE_VERSION != version:
Expand Down Expand Up @@ -282,13 +282,13 @@ def __init__(self, spi, cs, baudrate=1000000):
"""
Check the STMPE610 was found,Default clock rate 1000000 - can be changed with 'baudrate'
"""
import adafruit_bus_device.spi_device as spi_device
self._spi = spi_device.SPIDevice(spi, cs, baudrate=baudrate)
import adafruit_bus_device.spi_device as spidev
self._spi = spidev.SPIDevice(spi, cs, baudrate=baudrate)
# Check device version.
version = self.get_version
if _STMPE_VERSION != version:
# if it fails try SPI MODE 1 -- that is what Arduino does
self._spi = spi_device.SPIDevice(spi, cs, baudrate=baudrate, polarity=0, phase=1)
self._spi = spidev.SPIDevice(spi, cs, baudrate=baudrate, polarity=0, phase=1)
version = self.get_version
if _STMPE_VERSION != version:
raise RuntimeError('Failed to find STMPE610! Chip Version 0x%x' % version)
Expand Down

0 comments on commit 4930878

Please sign in to comment.