Skip to content

Commit 8fcab38

Browse files
authored
Merge pull request #14 from adafruit/patch-fix
Linted
2 parents 53240e3 + e34d422 commit 8fcab38

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

adafruit_matrixkeypad.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ def pressed_keys(self):
6262
pin.direction = Direction.INPUT
6363
pin.pull = Pull.UP
6464

65-
for row in range(len(self.row_pins)):
65+
for row, row_pin in enumerate(self.row_pins):
6666
# set one row low at a time
67-
self.row_pins[row].direction = Direction.OUTPUT
68-
self.row_pins[row].value = False
67+
row_pin.direction = Direction.OUTPUT
68+
row_pin.value = False
6969
# check the column pins, which ones are pulled down
70-
for col in range(len(self.col_pins)):
71-
if not self.col_pins[col].value:
70+
for col, val in enumerate(self.col_pins):
71+
if not val.value:
7272
pressed.append(self.keys[row][col])
7373
# reset the pin to be an input
74-
self.row_pins[row].direction = Direction.INPUT
75-
self.row_pins[row].pull = Pull.UP
74+
row_pin.direction = Direction.INPUT
75+
row_pin.pull = Pull.UP
7676
return pressed

0 commit comments

Comments
 (0)