So I have a Raspberry Pi Pico and am trying to setup KMK on it. I of course setup the Pico to boot into circuitpython version 9.
Problem is, I can't get the keypresses or rotary input to result in any kind of actual input to the PC its plugged into.
Please note, I know next to nothing about Python and this is the first time I've ever worked with programming a microcontroller.
Mostly been using tutorials from Youtube, or code examples from thingiverse.
No matter what I do, its like the code doesn't exist on the Pico.
Here is my pinout/key layout
[10] [6] [8] [9]
[11] [2] [1] [0]
Rotary Encoder is pinned as:
SW goes to 18
CLK goes to 19
DT goes to 21
I want
10 to be a key+combo of Ctrl Alt F3
6 to be Ctl Alt F12
11 to be Left Arrow
2 to be Play/Pause
1 to be right Arrow
Remaining key-connected pins will just have kc.no for placeholder (not sure what I want to use them for quite yet)
Rotary encoder will be volume control, clockwise increasing, counter-clockwise decreasing, and clicking in will toggle mute.
At one mount, I tried using the code example from https://www.thingiverse.com/thing:4920636
My macropad is laid out in a very similar way... except it has 8 keys instead of just 6.
I adjusted the code to reflect the in-use pins... as they differed from the code example.
Still it didn't work.
Biggest issue with trying to figure out the code, is that most examples of code are for keyboard matrix. But my Macropad is direct pin connection... no matrix.
In order to rule out possibility that Pico is damaged, I also tried doing the exact same thing to another PICO I have, mounted on a breadboard, with yet another rotary encoder I have.
Connecting Pin 0 to Ground... does not result in a key press... and neither does adjusting the rotary encoder do anything on the breadboard mounted Pico either. So it definitely seems to be software related.
More over proof of this, is that I found an "adafruit_macropad_default.uf2" file from adafruit site... and when I ran that on my Pico... it did in fact result in key presses on the computer the pico was connected to. Same goes for the rotary encoder, except those were registering as some character for each click, or turn increment. I cant just use that, because there doesnt seem to be any [obvious] way to edit the key assignments to something more useful for me.
I really have no idea what I'm doing wrong.
I even made sure that the lib folder contains adafruit_hid library files
kmk folder has been added into the "USB Drive F:" (not sure why it doesnt say Circuitpython)
There is a boot file also in the root directory alongisde the code file.
But the boot.py file is empty. No text in it. I got that from the KMK Firmware zip file... is it supposed to be emptY?
When unplugging and plugging back in pico, and still the macropad does not function... I do, however, see the pico flash the LED two times... then pauses for a about 3-5 seconds, and repeats flashing twice, then pause again... etc
This happens on the breadboarded pico as well as the pico that has already been soldered into all the switches and rotary encoder.
Any suggestions? Am I forgetting to do some sort of vital step?
Please understand I'm totally new at this and I literally dont know what I dont know.
Problem is, I can't get the keypresses or rotary input to result in any kind of actual input to the PC its plugged into.
Please note, I know next to nothing about Python and this is the first time I've ever worked with programming a microcontroller.
Mostly been using tutorials from Youtube, or code examples from thingiverse.
No matter what I do, its like the code doesn't exist on the Pico.
Here is my pinout/key layout
[10] [6] [8] [9]
[11] [2] [1] [0]
Rotary Encoder is pinned as:
SW goes to 18
CLK goes to 19
DT goes to 21
I want
10 to be a key+combo of Ctrl Alt F3
6 to be Ctl Alt F12
11 to be Left Arrow
2 to be Play/Pause
1 to be right Arrow
Remaining key-connected pins will just have kc.no for placeholder (not sure what I want to use them for quite yet)
Rotary encoder will be volume control, clockwise increasing, counter-clockwise decreasing, and clicking in will toggle mute.
At one mount, I tried using the code example from https://www.thingiverse.com/thing:4920636
My macropad is laid out in a very similar way... except it has 8 keys instead of just 6.
I adjusted the code to reflect the in-use pins... as they differed from the code example.
Still it didn't work.
Biggest issue with trying to figure out the code, is that most examples of code are for keyboard matrix. But my Macropad is direct pin connection... no matrix.
In order to rule out possibility that Pico is damaged, I also tried doing the exact same thing to another PICO I have, mounted on a breadboard, with yet another rotary encoder I have.
Connecting Pin 0 to Ground... does not result in a key press... and neither does adjusting the rotary encoder do anything on the breadboard mounted Pico either. So it definitely seems to be software related.
More over proof of this, is that I found an "adafruit_macropad_default.uf2" file from adafruit site... and when I ran that on my Pico... it did in fact result in key presses on the computer the pico was connected to. Same goes for the rotary encoder, except those were registering as some character for each click, or turn increment. I cant just use that, because there doesnt seem to be any [obvious] way to edit the key assignments to something more useful for me.
I really have no idea what I'm doing wrong.
I even made sure that the lib folder contains adafruit_hid library files
kmk folder has been added into the "USB Drive F:" (not sure why it doesnt say Circuitpython)
There is a boot file also in the root directory alongisde the code file.
But the boot.py file is empty. No text in it. I got that from the KMK Firmware zip file... is it supposed to be emptY?
When unplugging and plugging back in pico, and still the macropad does not function... I do, however, see the pico flash the LED two times... then pauses for a about 3-5 seconds, and repeats flashing twice, then pause again... etc
This happens on the breadboarded pico as well as the pico that has already been soldered into all the switches and rotary encoder.
Any suggestions? Am I forgetting to do some sort of vital step?
Please understand I'm totally new at this and I literally dont know what I dont know.
Statistics: Posted by JFox762 — Mon Mar 18, 2024 4:13 pm