mirror of
https://github.com/System-End/hackpad.git
synced 2026-04-20 00:35:24 +00:00
Merge pull request #620 from YashasSingh/main
GoonPad (I know this is late I realized that it didnt have the name of the pad)
This commit is contained in:
commit
04a766a5ec
13 changed files with 24109 additions and 0 deletions
BIN
hackpads/goonpad/PCB_PCB_macro-pt2_2025-02-20.png
Normal file
BIN
hackpads/goonpad/PCB_PCB_macro-pt2_2025-02-20.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
hackpads/goonpad/Schematic_macro-pt2_2025-02-20.png
Normal file
BIN
hackpads/goonpad/Schematic_macro-pt2_2025-02-20.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 131 KiB |
BIN
hackpads/goonpad/cad/Untitled v8.3mf
Normal file
BIN
hackpads/goonpad/cad/Untitled v8.3mf
Normal file
Binary file not shown.
69
hackpads/goonpad/firmware/code.py
Normal file
69
hackpads/goonpad/firmware/code.py
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
from machine import Pin, I2C
|
||||
import time
|
||||
import neopixel
|
||||
import ssd1306
|
||||
import usb_hid
|
||||
from adafruit_hid.keyboard import Keyboard
|
||||
from adafruit_hid.keycode import Keycode
|
||||
|
||||
# Configure Key Matrix
|
||||
rows = [Pin(pin, Pin.OUT) for pin in [A3, D7, D8]] # Adjust as per schematic
|
||||
cols = [Pin(pin, Pin.IN, Pin.PULL_DOWN) for pin in [D6, D9]] # Adjust as per schematic
|
||||
|
||||
# Configure Neopixel LEDs
|
||||
num_pixels = 9 # Adjust based on the schematic
|
||||
np = neopixel.NeoPixel(Pin(D10), num_pixels) # Adjust data pin
|
||||
|
||||
# Configure OLED Display
|
||||
i2c = I2C(0, scl=Pin(4), sda=Pin(5)) # Adjust pins
|
||||
oled = ssd1306.SSD1306_I2C(128, 32, i2c)
|
||||
|
||||
# Configure USB HID
|
||||
kbd = Keyboard(usb_hid.devices)
|
||||
|
||||
# Configure Rotary Encoder
|
||||
encoder_a = Pin(A1, Pin.IN, Pin.PULL_UP)
|
||||
encoder_b = Pin(A2, Pin.IN, Pin.PULL_UP)
|
||||
encoder_button = Pin(A0, Pin.IN, Pin.PULL_UP)
|
||||
encoder_pos = 0
|
||||
|
||||
def encoder_changed(pin):
|
||||
global encoder_pos
|
||||
if encoder_b.value() == 1:
|
||||
encoder_pos += 1
|
||||
else:
|
||||
encoder_pos -= 1
|
||||
update_oled(f"Encoder: {encoder_pos}")
|
||||
|
||||
encoder_a.irq(trigger=Pin.IRQ_RISING, handler=encoder_changed)
|
||||
|
||||
def scan_keys():
|
||||
for row_idx, row in enumerate(rows):
|
||||
row.value(1) # Activate row
|
||||
for col_idx, col in enumerate(cols):
|
||||
if col.value():
|
||||
return keymap[row_idx][col_idx]
|
||||
row.value(0) # Deactivate row
|
||||
return None
|
||||
|
||||
def update_oled(text):
|
||||
oled.fill(0)
|
||||
oled.text(text, 0, 0)
|
||||
oled.show()
|
||||
|
||||
def update_leds():
|
||||
for i in range(num_pixels):
|
||||
np[i] = (0, 50, 0) # Green color
|
||||
np.write()
|
||||
|
||||
while True:
|
||||
key = scan_keys()
|
||||
if key:
|
||||
kbd.send(key)
|
||||
update_oled(f"Key: {chr(key)}")
|
||||
update_leds()
|
||||
if not encoder_button.value():
|
||||
kbd.send(Keycode.ENTER)
|
||||
update_oled("Encoder Button Pressed")
|
||||
time.sleep(0.1)
|
||||
# type: ignore
|
||||
BIN
hackpads/goonpad/image-1.png
Normal file
BIN
hackpads/goonpad/image-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 110 KiB |
BIN
hackpads/goonpad/image.png
Normal file
BIN
hackpads/goonpad/image.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 187 KiB |
Binary file not shown.
Binary file not shown.
13994
hackpads/goonpad/production/bottom v18.step
Normal file
13994
hackpads/goonpad/production/bottom v18.step
Normal file
File diff suppressed because it is too large
Load diff
69
hackpads/goonpad/production/code.py
Normal file
69
hackpads/goonpad/production/code.py
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
from machine import Pin, I2C
|
||||
import time
|
||||
import neopixel
|
||||
import ssd1306
|
||||
import usb_hid
|
||||
from adafruit_hid.keyboard import Keyboard
|
||||
from adafruit_hid.keycode import Keycode
|
||||
|
||||
# Configure Key Matrix
|
||||
rows = [Pin(pin, Pin.OUT) for pin in [A3, D7, D8]] # Adjust as per schematic
|
||||
cols = [Pin(pin, Pin.IN, Pin.PULL_DOWN) for pin in [D6, D9]] # Adjust as per schematic
|
||||
|
||||
# Configure Neopixel LEDs
|
||||
num_pixels = 9 # Adjust based on the schematic
|
||||
np = neopixel.NeoPixel(Pin(D10), num_pixels) # Adjust data pin
|
||||
|
||||
# Configure OLED Display
|
||||
i2c = I2C(0, scl=Pin(4), sda=Pin(5)) # Adjust pins
|
||||
oled = ssd1306.SSD1306_I2C(128, 32, i2c)
|
||||
|
||||
# Configure USB HID
|
||||
kbd = Keyboard(usb_hid.devices)
|
||||
|
||||
# Configure Rotary Encoder
|
||||
encoder_a = Pin(A1, Pin.IN, Pin.PULL_UP)
|
||||
encoder_b = Pin(A2, Pin.IN, Pin.PULL_UP)
|
||||
encoder_button = Pin(A0, Pin.IN, Pin.PULL_UP)
|
||||
encoder_pos = 0
|
||||
|
||||
def encoder_changed(pin):
|
||||
global encoder_pos
|
||||
if encoder_b.value() == 1:
|
||||
encoder_pos += 1
|
||||
else:
|
||||
encoder_pos -= 1
|
||||
update_oled(f"Encoder: {encoder_pos}")
|
||||
|
||||
encoder_a.irq(trigger=Pin.IRQ_RISING, handler=encoder_changed)
|
||||
|
||||
def scan_keys():
|
||||
for row_idx, row in enumerate(rows):
|
||||
row.value(1) # Activate row
|
||||
for col_idx, col in enumerate(cols):
|
||||
if col.value():
|
||||
return keymap[row_idx][col_idx]
|
||||
row.value(0) # Deactivate row
|
||||
return None
|
||||
|
||||
def update_oled(text):
|
||||
oled.fill(0)
|
||||
oled.text(text, 0, 0)
|
||||
oled.show()
|
||||
|
||||
def update_leds():
|
||||
for i in range(num_pixels):
|
||||
np[i] = (0, 50, 0) # Green color
|
||||
np.write()
|
||||
|
||||
while True:
|
||||
key = scan_keys()
|
||||
if key:
|
||||
kbd.send(key)
|
||||
update_oled(f"Key: {chr(key)}")
|
||||
update_leds()
|
||||
if not encoder_button.value():
|
||||
kbd.send(Keycode.ENTER)
|
||||
update_oled("Encoder Button Pressed")
|
||||
time.sleep(0.1)
|
||||
# type: ignore
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
LCSC Part Number,Manufacture Part Number,Manufacturer,Package,Customer #,Description,RoHS,Order Qty.,Min\Mult Order Qty.,Unit Price($),Ext.Price($),Product Link
|
||||
C19702,CL10A106KP8NNNC,Samsung Electro-Mechanics,0603,"C1,C2,C3,C4,C5,C6,C7",10V 10uF X5R ±10% 0603 Multilayer Ceramic Capacitors MLCC - SMD/SMT ROHS,yes,20,20,0.0056,0.11,https://www.lcsc.com/product-detail/multilayer-ceramic-capacitors-mlcc-smd-smt_samsung-electro-mechanics-cl10a106kp8nnnc_C19702.html
|
||||
C192893,SL2.1A,CoreChips,SOP-16,U2,SOP-16 USB HUB Controllers ROHS,yes,5,5,0.2625,1.31,https://www.lcsc.com/product-detail/usb-hub-controllers_corechips-sl2-1a_C192893.html
|
||||
C2345,902-131A1011D10100,Jing Extension of the Electronic Co.,Plugin,"USB2,USB3,USB4,USB5",USB 2.0 1 4P Female Type-A Plugin USB Connectors ROHS,yes,10,10,0.0496,0.50,https://www.lcsc.com/product-detail/usb-connectors_jing-extension-of-the-electronic-co-902-131a1011d10100_C2345.html
|
||||
C189782,U-G-04WD-W-01,Korean Hroparts Elec,Plugin,USB6,1A USB 2.0 1 Bend-in Male -40℃~+85℃ Type-A Plugin USB Connectors ROHS,yes,5,5,0.0828,0.41,https://www.lcsc.com/product-detail/usb-connectors_korean-hroparts-elec-u-g-04wd-w-01_C189782.html
|
||||
|
9929
hackpads/goonpad/production/top v14.step
Normal file
9929
hackpads/goonpad/production/top v14.step
Normal file
File diff suppressed because it is too large
Load diff
43
hackpads/goonpad/readme.md
Normal file
43
hackpads/goonpad/readme.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# MacroPad Project
|
||||
|
||||
## Overview
|
||||
This is my custom-built MacroPad project.
|
||||
|
||||
## Images
|
||||
### MacroPad
|
||||

|
||||
|
||||
### Schematic
|
||||

|
||||
|
||||
### PCB
|
||||

|
||||
|
||||
### Case Assembly
|
||||

|
||||
|
||||
## Bill of Materials (BOM) per Keyboard
|
||||
- **6** MX-Style switches
|
||||
- **6** through-hole 1N4148 Diodes
|
||||
- **1** Seeed XIAO RP2040
|
||||
- **1** EC11 Rotary Encoder
|
||||
- **6** Black Blank DSA Keycaps
|
||||
- **9** SK6812 MINI-E LEDs
|
||||
- **4** M3x16mm Screws
|
||||
- **4** M3 Hex Nuts
|
||||
- **4** M3x5mmx4mm Heatset Inserts
|
||||
- **4** USB 2.0 1 4P Female Type-A Plugin USB Connectors ROHS
|
||||
- **1** 1A USB 2.0 1 Bend-in Male -40℃~+85℃ Type-A Plugin USB
|
||||
- **1** CoreChips SOP-16 USB HUB Controller ROHS
|
||||
- **7** 10V 10uF X5R ±10% 0603 Multilayer Ceramic Capacitors MLCC - SMD/SMT ROHS
|
||||
|
||||
## Assembly Instructions
|
||||
- Solder the diodes to the PCB.
|
||||
- Mount the MX-style switches.
|
||||
- Attach the Seeed XIAO RP2040 microcontroller.
|
||||
- Install the rotary encoder and LEDs.
|
||||
- Secure all components with the necessary screws and heatset inserts.
|
||||
- Connect the USB components as per the schematic.
|
||||
|
||||
This MacroPad is designed to be a versatile and customizable input device, perfect for various applications!
|
||||
|
||||
Loading…
Add table
Reference in a new issue