A keyboard and gamepad adapter dock for Playdate, mainly designed for use with the Playwrite experimental word processor, but compatible with any other Playdate game or app.
Overview thread with demo videos: https://twitter.com/t0m_fr/status/1576949261849149440
This repo is dedicated to the dock; it contains:
- Source code for the Teensy microcontroller board (as a PlatformIO project)
- CAD and STL files for the 3d-printed dock (see here for pictures and instructions)
For the Playwrite app for Playdate, see here.
The dock is powered by a Teensy 4.1 microcontroller. The USB Host port of the Teensy is used to connect to both a Playdate console and a USB HID keyboard (or gamepad). It reads user inputs from these devices and uses USB Serial to communicate with the Playdate, leveraging a few of the available USB commands to emulate native inputs, and listening to messages from the Playdate and Playwrite app.
The micro USB port of the Teensy is used to power the dock and flash the software. The dock also charges the Playdate though the Teensy (albeit slowly).
Arrow keys, Enter and Escape are directly mapped to the directions, A and B buttons respectively (and so are the A and S keys when not in the dedicated Playwrite app. So the keyboard can be used anywhere in the OS or in games that don't rely on the crank (not because it's unusable; but because it's just not convenient).
The Playwrite app sends a specific command to the serial console (KeyboardInputEnable
) to let the Teensy know that it can enable the "keyboard mode". In this mode, keyspresses are encoded as crankchange
angles in the dock (and decoded back to chars in the Playwrite app on the Playdate).
The dock software also supports USB Gamepads to some extent (tested on a couple of 8bitdo devices). This part of the project might arguably the most generally useful, as it could improve accessiblity of the device without the need of a full computer.
TODO: Cranking via the gamepad is not supported. Mapping the right analog stick to the crank would be nice.
TODO: Bluetooth is not supported but is likely doable thanks to the USBHost_t36 library.
It's a relatively cheap project. You'll need:
- A Teensy 4.1 microcontroller, with 4 pin header solderd to the USB Host port
- A USB 2.0 Hub
- Cables to connect your USB devices (Playdate, keyboard)
The exact references I used are linked in the dock assembly page.
Additionally you'll need access to a 3d printer if you want to print the dock itself.
Made possible by
Dependencies
- USBHost_t36 library
- CircularBuffer library