- Joined
- May 10, 2023
- Messages
- 1
- Reaction score
- 0
I have very little experience with programming, so bear with me.
I'm trying to do the example shown on KMKfw's "Getting Started" page (http://kmkfw.io/docs/Getting_Started/), but after creating the code.py file and pasting the example code, it's giving me an error.
I already installed Circuit Python onto my Raspberry Pi Pico RP2040, and I'm using Mu 1.2.0 to edit the file that the example code is on ~ code.py.
This is the error message:
code.py output:
Traceback (most recent call last):
File "code.py", line 18, in <module>
File "kmk/kmk_keyboard.py", line 473, in go
File "kmk/kmk_keyboard.py", line 497, in _init
File "kmk/kmk_keyboard.py", line 337, in _init_matrix
File "kmk/scanners/keypad.py", line 52, in init
TypeError: object of type 'Pin' has no len()
Code done running.
-----------------------------------------------------------------------
keypad.py has the following code at line 52:
class MatrixScanner(KeypadScanner):
'''
Row/Column matrix using the CircuitPython 7 keypad scanner.
aram row_pins: A sequence of pins used for rows.
aram col_pins: A sequence of pins used for columns.
aram direction: The diode orientation of the matrix.
'''
def init(
self,
row_pins,
column_pins,
*,
columns_to_anodes=DiodeOrientation.COL2ROW,
interval=0.02,
max_events=64,
):
self.keypad = keypad.KeyMatrix(
row_pins,
column_pins, # (Below is line 52)
columns_to_anodes=(columns_to_anodes == DiodeOrientation.COL2ROW),
interval=interval,
max_events=max_events,
)
super().init()
Has anyone else come across this while using kmkfw? I don't truly understand the len() error message, so I'm hoping someone can point me into the right direction. Thank you.
I'm trying to do the example shown on KMKfw's "Getting Started" page (http://kmkfw.io/docs/Getting_Started/), but after creating the code.py file and pasting the example code, it's giving me an error.
I already installed Circuit Python onto my Raspberry Pi Pico RP2040, and I'm using Mu 1.2.0 to edit the file that the example code is on ~ code.py.
This is the error message:
code.py output:
Traceback (most recent call last):
File "code.py", line 18, in <module>
File "kmk/kmk_keyboard.py", line 473, in go
File "kmk/kmk_keyboard.py", line 497, in _init
File "kmk/kmk_keyboard.py", line 337, in _init_matrix
File "kmk/scanners/keypad.py", line 52, in init
TypeError: object of type 'Pin' has no len()
Code done running.
-----------------------------------------------------------------------
keypad.py has the following code at line 52:
class MatrixScanner(KeypadScanner):
'''
Row/Column matrix using the CircuitPython 7 keypad scanner.
aram row_pins: A sequence of pins used for rows.
aram col_pins: A sequence of pins used for columns.
aram direction: The diode orientation of the matrix.
'''
def init(
self,
row_pins,
column_pins,
*,
columns_to_anodes=DiodeOrientation.COL2ROW,
interval=0.02,
max_events=64,
):
self.keypad = keypad.KeyMatrix(
row_pins,
column_pins, # (Below is line 52)
columns_to_anodes=(columns_to_anodes == DiodeOrientation.COL2ROW),
interval=interval,
max_events=max_events,
)
super().init()
Has anyone else come across this while using kmkfw? I don't truly understand the len() error message, so I'm hoping someone can point me into the right direction. Thank you.