A 3D-printed USB macropad based on the Tiny 2040, with customizable Rust firmware.
Getting Started »
Printables Page
·
Report Bug
·
Onshape Project
Built with:
Table of Contents
The Ghostwriter is a small, customizable macro pad based on the Tiny 2040 development board (with RaspberryPi rp2040 inside).
It has a single button — can be used to write a letter, start a macro, etc — and an LED for feedback. It connects through USB-C and shows up as a USB device.
Everything (from the LED color and blinking patterns, button actions, USB product display name) is configurable in the source code. Some pre-built firmwares are also available (see Getting Started).
To install the lorem
firmware — spitting out lorem ipsum on the press of a button — follow the next steps.
Note
These instructions focus on the Firmware. For instructions on how to 3D print the Ghostwriter case please refer to the Printables page.
In order to install the firmware (lorem
) you need:
- A Tiny 2040 microcontroller board.
- Download the
lorem.uf2
firmware from the Release page. - Press the
boot
button of the Tiny 2040 and (with theboot
button pressed) connect it to your computer via USB. NOTE: If you have printed the Ghostwriter case, theboot
button is the (one and only) button pressed when you squeeze the case. - Verify that the Tiny 2040 is mounted as removable storage.
- Drag and drop the
lorem.uf2
firmware to the removable storage volume. - SUCCESS! The Tiny 2040 reboots and loads the firmware.
The eyes (the LED) should be green and blinking slowly. Open a text editor and press the boot
button (or squeeze the case). The eyes are now lavender-pink and blinking fast. The Ghostwriter is writing to your text editor. The Ghostwriter will keep writing (potentially starting the lorem ipsum over) until you press it again.
See the Building section for instructions on how to build and tweak the code yourself.
Make sure you have a recent vesion of Rust installed, as well as the right target for the rp2040
:
rustup self update
rustup update stable
rustup target add thumbv6m-none-eabi
Build the lorem
firmware:
cargo build --release --bin lorem
Make sure elf2uf2-rs is installed. Then deploy the firmware to the Tiny 2040 (ensure the device is connect and in boot mode, i.e. boot
was pressed when plugging the device):
Note
The command below uses the runner
specified in .cargo/config
to convert the cargo-built ELF file to uf2 and deploy it to the connected Tiny 2040.
cargo install elf2uf2-rs
cargo run --release --bin lorem
Nicolas Mattia - @nasmattia - nicolas@nmattia.com
Project Link: https://github.com/nmattia/ghostwriter
- rust-embedded and their great guides & libraries
- Pimoroni and RaspberryPi Foundation for producing super cool hardware
- Onshape for CAD done right
- Prusa and the Voron team for making and designing great printers
- Othneil Drew's README template