Skip to content

fix pylint issue #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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