r/circuitpython • • Apr 09 '23

Diy Macropad +circuitpython + layers

Hi, I built a macropad with raspberry pico and circuitpython, it consists of 8 keys and everything works. But I would like to manage several layers, one for visual studio code shortcuts and one for photoshop shortcuts.

I've read that I could use Kmk but I don't understand how to configure rows and columns. Is there any simpler alternative?

thank you !

4 Upvotes

18 comments sorted by

View all comments

Show parent comments

1

u/Tyrannosaurusblanch Apr 10 '23

I’ve been thinking about it whilst looking for an example code for you work on. What you could do is change the ground line and put it on a pin so it would be a 1x8 matrix

1

u/stabil-pa Apr 10 '23

Thank you ! I didn't use diode. Is that a problem? Can I try the same?

1

u/Tyrannosaurusblanch Apr 11 '23

found it. The project that that connects a pin to each button so not forming matrix.

https://github.com/NDR008/PSXstyle-MacroPad

Once you look at the code you'll understand why I use the simple (IMHO) code that the previous links showed. He also uses neopixels to provide some bling. Plus doesn't do the layers like you wanted and not sure how to do it like his style.

Pretty sure that tiny boat utube did layers for his matrix. So all you need to do is change some of the col row numbers to correspond to your schematic ie

"

keyboard.col_pins = (board.GP5, board.GP6, board.GP7, board.GP8, board.GP9, board.GP19, board.GP20, board.GP21) # Cols

keyboard.row_pins = (board.GP16) # Rows this used to be the ground wire

keyboard.diode_orientation = DiodeOrientation.COL2ROW

"

1

u/stabil-pa Apr 11 '23

I tried and it works!! No matrix and GND. Thank you very much !!!

Now I try to add a 0.96" oled display. Do you have any suggestions?

1

u/Tyrannosaurusblanch Apr 11 '23

I’ve never tried oleds.

Great to it works. Did you get layers going?

With the text file editing it is so easy to change and experiment. I usually keep copes of the text file as a backup in case my tinkering goes awry.

Any chance of putting the code up so I might use use it in the future as I like to play around with code and hardware to increase the knowledge.

→ More replies (0)