File tree 1 file changed +5
-7
lines changed 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -62,17 +62,15 @@ def pressed_keys(self):
62
62
pin .direction = Direction .INPUT
63
63
pin .pull = Pull .UP
64
64
65
- for row in range ( # pylint: disable=consider-using-enumerate
66
- len (self .row_pins )
67
- ):
65
+ for row , row_pin in enumerate (self .row_pins ):
68
66
# set one row low at a time
69
- self . row_pins [ row ] .direction = Direction .OUTPUT
70
- self . row_pins [ row ] .value = False
67
+ row_pin .direction = Direction .OUTPUT
68
+ row_pin .value = False
71
69
# check the column pins, which ones are pulled down
72
70
for col , val in enumerate (self .col_pins ):
73
71
if not val .value :
74
72
pressed .append (self .keys [row ][col ])
75
73
# reset the pin to be an input
76
- self . row_pins [ row ] .direction = Direction .INPUT
77
- self . row_pins [ row ] .pull = Pull .UP
74
+ row_pin .direction = Direction .INPUT
75
+ row_pin .pull = Pull .UP
78
76
return pressed
You can’t perform that action at this time.
0 commit comments