Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nmattia/ghostwriter

3D printed, DIY macropad powered by Rust and rp2040 ๐Ÿ‘ป
https://github.com/nmattia/ghostwriter

3d-printing microcontroller onshape pimoroni raspberry-pi raspberry-pi-pico rust tiny2040

Last synced: 3 months ago
JSON representation

3D printed, DIY macropad powered by Rust and rp2040 ๐Ÿ‘ป

Awesome Lists containing this project

README

        





Ghostwriter logo

Ghostwriter


A 3D-printed USB macropad based on the Tiny 2040, with customizable Rust firmware.


Getting Started ยป




Printables Page
ยท
Report Bug
ยท
Onshape Project




Built with:



RaspberryPi rp2040


Rust Language


Onshape


Table of Contents



  1. About The Project


  2. Getting Started


  3. Building

  4. Contact

  5. Acknowledgments

## About The Project






Ghostwriter DIY USB macropad






The Ghostwriter is a small, customizable macro pad based on the [Tiny 2040][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](#getting-started)).

(back to top)

## Getting Started

To install the `lorem` firmware โ€” spitting out lorem ipsum on the press of a button โ€” follow the next steps.




Ghostwriter printing lorem ipsum

> [!NOTE]
> These instructions focus on the Firmware. For instructions on how to 3D print the
> Ghostwriter case please refer to the [Printables page][printables-ghostwriter].

### Prerequisites

In order to install the firmware (`lorem`) you need:

* A [Tiny 2040][tiny-2040] microcontroller board.

### Installing the Firmware

1. Download the `lorem.uf2` firmware from the [Release page][releases].
2. Press the `boot` button of the Tiny 2040 and (with the `boot` button pressed) connect it to your computer via USB. **NOTE**: If you have printed the [Ghostwriter case][printables-ghostwriter], the `boot` button is the (one and only) button pressed when you squeeze the case.
3. Verify that the Tiny 2040 is mounted as removable storage.
4. Drag and drop the `lorem.uf2` firmware to the removable storage volume.
5. **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](https://loremipsum.io) over) until you press it again.

See the [Building](#building) section for instructions on how to build and tweak the code yourself.

(back to top)

## Building

Make sure you have a recent vesion of Rust installed, as well as the right target for the `rp2040`:

```bash
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](https://github.com/JoNil/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
```

(back to top)

## Contact

[Nicolas Mattia][nmattia.com] - [@nasmattia](https://twitter.com/nasmattia) - [email protected]

Project Link: [https://github.com/nmattia/ghostwriter](https://github.com/nmattia/ghostwriter)

(back to top)

## Acknowledgments

* [rust-embedded](https://github.com/rust-embedded) and their great guides & libraries
* [Pimoroni](https://shop.pimoroni.com) and [RaspberryPi Foundation](https://www.raspberrypi.com) for producing super cool hardware
* [Onshape][onshape-url] for CAD done right
* [Prusa](https://www.prusa3d.com) and the [Voron team](http://vorondesign.com) for making and designing great printers
* [Othneil Drew's README template](https://github.com/othneildrew/Best-README-Template)

(back to top)

[rp2040]: https://img.shields.io/badge/rp2040-DDDDDD?style=for-the-badge&logo=raspberrypi&logoColor=red
[rp2040-url]: https://www.raspberrypi.com/products/rp2040/
[rust]: https://img.shields.io/badge/rust-f59042?style=for-the-badge&logo=rust&logoColor=grey
[rust-url]: https://www.rust-lang.org
[onshape]: https://img.shields.io/badge/onshape-000000?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyBpZD0iZU1vOThjemhwR1QxIiB4bWxucz0i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E5IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjxsaW5lIHgxPSIxNi42Mzg4IiB5MT0iMjQuNzUiIHgyPSIxOS42Njk5IiB5Mj0iMjYuNSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L2c+PC9zdmc+DQo=

[onshape-url]: https://onshape.com

[releases]: https://github.com/nmattia/ghostwriter/releases

[printables-ghostwriter]: https://www.printables.com/model/1055689-ghostwriter-usb-macropad

[nmattia.com]: https://nmattia.com

[tiny-2040]: https://shop.pimoroni.com/products/tiny-2040