Ir para conteúdo
3DFinder
Entrar

Você está no 3DFinder

Buscamos em Thingiverse, MakerWorld e Printables ao mesmo tempo para te dar o melhor de cada uma.

Buscar mais como este
Modelo 3D 4x1 Macro Keypad por Thinner42 no Printables

Descrição

Required hardware

  • Raspberry Pi Pico (RP2040) microcontroller board
  • USB cable (as it has to be cut and soldered a USB 2.0 is preferred, because it only has 4 wires)
  • 4x Cherry MX key switches or other with similar size
  • 4x Keycaps (or print your own)
  • 4x M2x6 flat head self-tapping screws (overall length should be between 6 and 8 mm)
  • (optional) 2x M2x5 flat head self-tapping screws  (to fix the microcontroller board)
  • (optional) 4x small rubber feet (I used 2 mm height with a diameter of 8 mm)
  • 2 small zip ties (to fix the cable, should be less than 3 mm in with) 
  • 5x short cable peices and a soldering iron/station (to connect the switches with the microcontroller board)
  • A multimeter or tester is strongly recommended to test the cable connections, as the cable colors can be random (mine had +5v on black and ground on red)

Note: This model was created with the intent to directly solder the USB cable to the microcontroller board, because of space constrains. It may also be possible to get a cable (or modify one) that can be directly connected.

Printing 

My print used PLA with 0.2 mm layer height and a 0.4 mm nozzle without support.
I used Filament PM Marble Jet Dark which gave nice results, other filaments may require a finer layer height.

Build instructions

  1. Insert the four key switches in the top part
  2. Cut a USB cable and solder it directly to the test points
    (If the cable has different cable colors, you could connect the other end to the micro USB port and measured for continuity to the test points to find the correct cable color.)
    • TP1 to ground
    • TP2 to USB D-
    • TP3 to USB D+
    • VBUS to +5 V
  3. Connect one side of all switches to one pin (ex. GP5)
  4. Connect the other sides of the switches to four other pins (ex. GP6, GP7, GP8, GP9)
  5. Insert the cable in the cutout of the bottom piece and fix it with zip ties
  6. Fix the microcontroller board to the bottom piece by using two small screws
  7. Connect the Raspberry Pi Pico to the computer
  8. Download and install Circuit Python on the Pico
  9. Download KMK from [https://github.com/KMKfw/kmk_firmware](https://github.com/KMKfw/kmk_firmware)
  10. Place a “code.py” which defines your keymap etc. (see below as starting point)
  11. (optional) If the “CIRCUITPY” drive and serial port should be hidden, create a “boot.py” as well (see below as starting point).
    • If you use the example below, press and hold the first button when connecting to re-enable the drive and serial port to allow configuration
  12. Modify your macro keypad as you like

Example code.py:

print("Starting")

import board

from kmk.kmk_keyboard import KMKKeyboard from kmk.keys import KC from kmk.scanners import DiodeOrientation

keyboard = KMKKeyboard()

keyboard.col_pins = (board.GP5,) keyboard.row_pins = (board.GP9,board.GP8,board.GP7,board.GP6,) keyboard.diode_orientation = DiodeOrientation.COL2ROW

keyboard.keymap = [ [KC.A, KC.B, KC.C, KC.D,] ]

if name == 'main': keyboard.go()

Example boot.py:

import supervisor
import board
import digitalio
import storage
import usb_cdc
import usb_hid

from code import keyboard from kmk.scanners import DiodeOrientation

If this key is held during boot, don't run the code which hides the storage and disables serial

This will use the first row/col pin. Feel free to change it if you want it to be another pin

col = digitalio.DigitalInOut(keyboard.col_pins[0]) row = digitalio.DigitalInOut(keyboard.row_pins[0])

if keyboard.diode_orientation == DiodeOrientation.COLUMNS: col.switch_to_output(value=True) row.switch_to_input(pull=digitalio.Pull.DOWN) else: col.switch_to_input(pull=digitalio.Pull.DOWN) row.switch_to_output(value=True)

if not row.value: storage.disable_usb_drive() # Equivalent to usb_cdc.enable(console=False, data=False) usb_cdc.disable() usb_hid.enable(boot_device=1)

row.deinit() col.deinit()

 

Printables

4x1 Macro Keypad

Publicado em 29 de dez de 2022

49
Curtidas
249
Downloads
2
Impressões
Categoria Computers
Tags
raspberry keyboard cherry step cherrymx macro qmk pico kmk rp2040
Licença Creative Commons — Attribution — Noncommercial — Share Alike
Arquivos (2)
Keypad_4x1.stl 366 KB
Keypad_4x1.step 252.5 KB
Ver no Printables (abre em nova aba)