Skip to content

Add my hackpad #713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions hackpads/RohansMacroPad/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# RohansMacroPad

![Render](readme_images/full_render.png)

## What it is
I wanted to follow the tutorial on [hackpad.hackclub.com](hackpad.hackclub.com) accurately and make a macropad.

### Specs
BOM:
- 4x Cherry MX Switches
- 1x SK6812 MINI Leds
- 1x RotaryEncoder_Switch
- 1x XIAO RP2040
- 4x Blank DSA Keycaps
- 4x M3x16 Bolt
- 4x M3 Heatset

Others:
- KMK - main.py
- Hackpad Base.step
- Hackpad Cover.step

## What it does
Gives me one point on Highway per extra key I will now have to press and make my computer do things.

## What it looks like
This is an image of the PCB plan, from KiCad.

![PCB](readme_images/pcb.png)

This is an image of the schematic, from KiCad.

![Schematic](readme_images/schematic.png)

This is an image of the Hackpad case.

![Hackpad Case](readme_images/hackpad_render.png)

## How I made it
I followed the tutorial on Hackclub's website! It was very good at teaching me the basics of everything!
I kinda gave up for a few weeks before picking it back up again. I am working on my Summer of Making project at the same time!

I made a big mistake, and tried to submit the same thing as in the tutorial. I missed the part where it specifies that it must be something different, LOL.
I fixed it all up pretty quick after that, though, spending two days making my own unique design and submitting it.
120,923 changes: 120,923 additions & 0 deletions hackpads/RohansMacroPad/cad/Hackpad.step

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions hackpads/RohansMacroPad/firmware/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# You import all the IOs of your board
import board

# These are imports from the kmk library
from kmk.kmk_keyboard import KMKKeyboard
from kmk.scanners.keypad import KeysScanner
from kmk.keys import KC
from kmk.modules.macros import Press, Release, Tap, Macros
from kmk.modules.encoder import EncoderHandler
from kmk.extensions.rgb import RGB

# This is the main instance of your keyboard
keyboard = KMKKeyboard()

# Add the macro extension
macros = Macros()
keyboard.modules.append(macros)

# Rotary Encoder implementation
encoder_handler = EncoderHandler()
keyboard.modules.append(encoder_handler)

encoder_handler.pins = ((board.A0, board.A1),) # A0 = GPIO26, A1 = GPIO27
encoder_handler.map = [((KC.VOLD, KC.VOLU),)] # Rotate left/right

# LED implementation
rgb_ext = RGB(pixel_pin=board.D4, num_pixels=1)
keyboard.extensions.append(rgb_ext)

# Define your pins here!
PINS = [board.D1, board.D2, board.D4, board.D3]
# Encoder button
PINS.append(board.A2)

# Tell kmk we are not using a key matrix
keyboard.matrix = KeysScanner(
pins=PINS,
value_when_pressed=False,
)

# Here you define the buttons corresponding to the pins
# Look here for keycodes: https://github.com/KMKfw/kmk_firmware/blob/main/docs/en/keycodes.md
# And here for macros: https://github.com/KMKfw/kmk_firmware/blob/main/docs/en/macros.md
keyboard.keymap = [
[
KC.A,
KC.DELETE,
KC.MACRO("Hello world!"),
KC.Macro(Press(KC.LCMD), Tap(KC.S), Release(KC.LCMD)),
KC.ENTER,
]
]

# Start kmk!
if __name__ == '__main__':
keyboard.go()
Loading