Skip to content

Commit 95d2f6c

Browse files
committed
linty
1 parent 1bcae8d commit 95d2f6c

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

adafruit_pcd8544.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"""
4545

4646
import time
47+
from micropython import const
4748
from adafruit_bus_device import spi_device
4849
try:
4950
import framebuf
@@ -73,6 +74,7 @@
7374

7475
class PCD8544(object):
7576
"""Nokia 5110/3310 PCD8544-based LCD display."""
77+
# pylint: disable=too-many-instance-attributes
7678

7779
def __init__(self, spi, dc_pin, cs_pin, reset_pin=None, *,
7880
contrast=80, bias=4, baudrate=1000000):
@@ -100,6 +102,10 @@ def __init__(self, spi, dc_pin, cs_pin, reset_pin=None, *,
100102
self.fill_rect = self.framebuf.fill_rect
101103
self.rect = self.framebuf.rect
102104

105+
self._contrast = None
106+
self._bias = None
107+
self._invert = False
108+
103109
self.reset()
104110
# Set LCD bias.
105111
self.bias = bias
@@ -120,11 +126,11 @@ def write_cmd(self, cmd):
120126
with self.spi_device as spi:
121127
spi.write(bytearray([cmd]))
122128

123-
def extended_command(self, c):
129+
def extended_command(self, cmd):
124130
"""Send a command in extended mode"""
125131
# Set extended command mode
126132
self.write_cmd(_PCD8544_FUNCTIONSET | _PCD8544_EXTENDEDINSTRUCTION)
127-
self.write_cmd(c)
133+
self.write_cmd(cmd)
128134
# Set normal display mode.
129135
self.write_cmd(_PCD8544_FUNCTIONSET)
130136
self.write_cmd(_PCD8544_DISPLAYCONTROL | _PCD8544_DISPLAYNORMAL)

examples/pcd8544_simpletest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
print("Lines test")
3434
# we'll draw from corner to corner, lets define all the pair coordinates here
3535
corners = ((0, 0), (0, display.height-1), (display.width-1, 0),
36-
(display.width-1, display.height-1))
36+
(display.width-1, display.height-1))
3737

3838
display.fill(0)
3939
for corner_from in corners:
40-
for corner_to in corners:
41-
display.line(corner_from[0], corner_from[1],
42-
corner_to[0], corner_to[1], 1)
40+
for corner_to in corners:
41+
display.line(corner_from[0], corner_from[1],
42+
corner_to[0], corner_to[1], 1)
4343
display.show()
4444
time.sleep(0.1)
4545

@@ -48,7 +48,7 @@
4848
w_delta = display.width / 10
4949
h_delta = display.height / 10
5050
for i in range(11):
51-
display.rect(0, 0, int(w_delta*i), int(h_delta*i), 1)
51+
display.rect(0, 0, int(w_delta*i), int(h_delta*i), 1)
5252
display.show()
5353
time.sleep(0.1)
5454

0 commit comments

Comments
 (0)