The MidiFoot is a USB MIDI controller with a single button. It can be used as a sustain pedal, toggle switch, or even a 4, 8, or 16-step sequencer. Each press and release of the pedal/button sends a CC#64 (hold pedal) message on MIDI channel 15, with values in a specific sequence as shown below, which can be routed/mapped to perform the desired functions.

The MidiFoot uses a little 8-bit ATTiny85 microcontroller to emulate a class-compliant USB device. It's designed on a compact PCB that uses all through-hole parts.

Notes

The 8-bit AVR microcontrollers have become a bit boutique and hard to source cheaply. Modern platforms like the Raspberry Pi Pico could accomplish this same application, and are easier to use and more customizable. The MidiFoot could be interesting as a general microcontroller platform that is quite compact and uses all through-hole parts, perhaps if combined with a bootloader to make it more easily programmable. Future development on this project will go in one or both of those directions.