We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53240e3 commit 7e5f257Copy full SHA for 7e5f257
adafruit_matrixkeypad.py
@@ -62,13 +62,15 @@ def pressed_keys(self):
62
pin.direction = Direction.INPUT
63
pin.pull = Pull.UP
64
65
- for row in range(len(self.row_pins)):
+ for row in range( # pylint: disable=consider-using-enumerate
66
+ len(self.row_pins)
67
+ ):
68
# set one row low at a time
69
self.row_pins[row].direction = Direction.OUTPUT
70
self.row_pins[row].value = False
71
# check the column pins, which ones are pulled down
- for col in range(len(self.col_pins)):
- if not self.col_pins[col].value:
72
+ for col, val in enumerate(self.col_pins):
73
+ if not val.value:
74
pressed.append(self.keys[row][col])
75
# reset the pin to be an input
76
self.row_pins[row].direction = Direction.INPUT
0 commit comments