Blueprint

Hackpad!

A 12-keyhackpad built around the Seeed XIAO RP2040. Per-key RGB OLED display 3D-printed case.

Created by Lingfeng Wang Lingfeng Wang

Hackpad

54 views

1 follower

theodore theodore gave kudos to Hackpad! ago

its incredibly amazing dude !!, keep it up !!!

m0.hid m0.hid approved Hackpad! ago

Tickets awarded: 112 tickets

Tier: 5

This is a really cool hackpad! It looks really clean and i love the underglow you have on the switches, it makes it look really polished and well made

Lingfeng Wang Lingfeng Wang submitted Hackpad! for review ago

Lingfeng Wang Lingfeng Wang added to the journal ago

Merged Code Together

IMG_1115

I rewrote all the code, merging everything together. I made classes for each section of the hackpad, and measured how long it took each segment to run. Then, I could set proper refresh rates for each unit of the hackpad. (neopixels, button scanning, oled)

Keyscanning code: image

Neopixel code:image

OLED code:
image
The OLED updates run every 0.05 seconds just because it takes a bit longer, and the delay is barely noticeable at that rate.

Looking at update times, it is already very fast.
image

image
After some tweaking, I came to a good middle ground. 4fps animation + somewhat smooth leds. Its not great, but since i cant use both cores with circuitpython and micropython is just clunky, this will suffice for now.

Lingfeng Wang Lingfeng Wang added to the journal ago

Finally got OLED to work

image

After rewriting the gif converter to give me frames in bmp files, I was finally able to make the oled display the gif. The gif is from here btw: https://www.pixilart.com/art/bongo-cat-78caef9cd7ccd97

It automatically centers the gif and flips the colors since the OLED is inverted? Not sure why it is but it worked so I'll leave it.
IMG_1114

Lingfeng Wang Lingfeng Wang added to the journal ago

back to circuitpython

turns out micropython is bad when i need to use keyboard + serial. so, i had to move back to circuitpython + slightly worse keypressing.

Also, I kinda gave up on system stats. Everything I tried, from hwinfo to open hardware monitor would not work, and debugging with serial was too much of a chore. Instead, it just has a cat there instead.

image

No image, but I was able to finally get an animation playing.
IT was so annoying I turned to AI for help, which did not help (actually took 4 hours)

Now I need to figure out how to make the gif's lines more defined(should be quick)

Lingfeng Wang Lingfeng Wang added to the journal ago

OLED Status updates

I wanted the OLED to monitor my computers vitals (ram,cpu,gpu,temp,etc). I added some code that would read from the serial and output values.

image

Then, I needed to write a python script that puts these values onto the serial monitor.
image

I eventually switched to micropython to utilize both cores + make updates faster.
image

Notes: this only works for intel cpu + gpu, may need tweaks for other hardware

Lingfeng Wang Lingfeng Wang added to the journal ago

LED + Switch Firmware

The firmware took quite a long time to write, partly because I wrote it in notepad, and partly because I wanted it to be fancy.

image

I wanted the switches to make the leds surrounding the switch pulse, so it took a long time to figure out how to do that without blocking the main thread. I ended up using a dict to count how long each led had to stay on, which would be set to different amounts based on whether it was under the switch or a neighbor.

Lingfeng Wang Lingfeng Wang added to the journal ago

Soldered Switches and OLED

After making sure the leds worked, I soldered on the switches and oled.
image
In terms of the oled, I spent quite a while bending the pins to make sure that it would sit flush with the case.
The case actually had a little section that stuck out too much, so I just chopped it off.
After putting it into the case, the keycaps looked nice, but I decided to temporarily replace it with my other ones just to see how they would look.
image

Lingfeng Wang Lingfeng Wang added to the journal ago

Soldered LEDS and diodes

Before putting on switches, I soldered on the rp2040, leds and diodes. I was able to test how the leds worked, and they were great. From previous experience, I made sure to pre-tin all the pads, since the first time I tried soldering these LEDS, none of them worked because I forgot to do that.

image

I wrote a simple script to run rgb on all 12 leds, just to make sure they work. Nothing to difficult there.

My PCB design also had the led pads wrong, so I had to cut a trace and bring a wire to the other end. I basically reversed the din and dout, so they were all connected fine, other than the first/last one.

image

Tanuki Tanuki ⚡🚀 approved Hackpad! ago

sick hackpad!

Lingfeng Wang Lingfeng Wang submitted Hackpad! for review ago

Lingfeng Wang Lingfeng Wang started Hackpad! ago

1/23/2026 8:35 PM - Soldered LEDS and diodes

Before putting on switches, I soldered on the rp2040, leds and diodes. I was able to test how the leds worked, and they were great. From previous experience, I made sure to pre-tin all the pads, since the first time I tried soldering these LEDS, none of them worked because I forgot to do that.

image

I wrote a simple script to run rgb on all 12 leds, just to make sure they work. Nothing to difficult there.

My PCB design also had the led pads wrong, so I had to cut a trace and bring a wire to the other end. I basically reversed the din and dout, so they were all connected fine, other than the first/last one.

image

1/23/2026 8:40 PM - Soldered Switches and OLED

After making sure the leds worked, I soldered on the switches and oled.
image
In terms of the oled, I spent quite a while bending the pins to make sure that it would sit flush with the case.
The case actually had a little section that stuck out too much, so I just chopped it off.
After putting it into the case, the keycaps looked nice, but I decided to temporarily replace it with my other ones just to see how they would look.
image

1/23/2026 8:42 PM - LED + Switch Firmware

The firmware took quite a long time to write, partly because I wrote it in notepad, and partly because I wanted it to be fancy.

image

I wanted the switches to make the leds surrounding the switch pulse, so it took a long time to figure out how to do that without blocking the main thread. I ended up using a dict to count how long each led had to stay on, which would be set to different amounts based on whether it was under the switch or a neighbor.

1/23/2026 9 PM - OLED Status updates

I wanted the OLED to monitor my computers vitals (ram,cpu,gpu,temp,etc). I added some code that would read from the serial and output values.

image

Then, I needed to write a python script that puts these values onto the serial monitor.
image

I eventually switched to micropython to utilize both cores + make updates faster.
image

Notes: this only works for intel cpu + gpu, may need tweaks for other hardware

1/24/2026 1 AM - back to circuitpython

turns out micropython is bad when i need to use keyboard + serial. so, i had to move back to circuitpython + slightly worse keypressing.

Also, I kinda gave up on system stats. Everything I tried, from hwinfo to open hardware monitor would not work, and debugging with serial was too much of a chore. Instead, it just has a cat there instead.

image

No image, but I was able to finally get an animation playing.
IT was so annoying I turned to AI for help, which did not help (actually took 4 hours)

Now I need to figure out how to make the gif's lines more defined(should be quick)

1/24/2026 4 PM - Finally got OLED to work

image

After rewriting the gif converter to give me frames in bmp files, I was finally able to make the oled display the gif. The gif is from here btw: https://www.pixilart.com/art/bongo-cat-78caef9cd7ccd97

It automatically centers the gif and flips the colors since the OLED is inverted? Not sure why it is but it worked so I'll leave it.
IMG_1114

1/24/2026 6 PM - Merged Code Together

IMG_1115

I rewrote all the code, merging everything together. I made classes for each section of the hackpad, and measured how long it took each segment to run. Then, I could set proper refresh rates for each unit of the hackpad. (neopixels, button scanning, oled)

Keyscanning code: image

Neopixel code:image

OLED code:
image
The OLED updates run every 0.05 seconds just because it takes a bit longer, and the delay is barely noticeable at that rate.

Looking at update times, it is already very fast.
image

image
After some tweaking, I came to a good middle ground. 4fps animation + somewhat smooth leds. Its not great, but since i cant use both cores with circuitpython and micropython is just clunky, this will suffice for now.