Jul 192012

Standing desk with foot pedals

I’ve recently switched to a standing desk from Geek Desk and wanted to be able to free my hands for more important things, like drinking coffee. The foot pedals are a cast off Behringer FCB1010 MIDI foot controller, which outputs events as MIDI messages. To make it work with any computer without requiring additional software, I wrote a combination MIDI to USB HID mouse and keyboard converter that runs on a Teensy 2.0.

The Teensy translates the pedal events into various mouse or keyboard events (Escape to return to command mode in vi, Shift-Insert to paste the X11 cut buffer, mouse wheel events for the pedals, etc). Full source is available to build your own and configure your own mappings. Read on for some details on the hardware interface.


The right way to interface with MIDI is using an opto-coupler to convert the current loop into TTL, but that would require additional hardware. As a quick hack I used a 220 Ohm resistor on the signaling line and tied the grounds together. Since the ATMega32u4 has a hardware UART, I configured it to read the 31250 N81 MIDI signal.

Since the device is pretending to be both a mouse and a keyboard, the sample code from pjrc needed quite a few hacks to implement both USB endpoints. I’ve been slowly reworking this code to use structs rather than arrays of bytes for the descriptors to make it easier to read; this device is a hacked up version of my USB Morse code keyboard.

Are you interested in learning how to make USB input devices with the ATMegas? We’re scheduling a class at NYCR on the topic for later this fall, so keep an eye on the calendar.

 Posted by at 8:50 pm

  5 Responses to “USB Foot pedals for a standing desk”

Comments (5)
  1. Me! I’m interested!

  2. Cool stool!! Who makes it???

    • It is a Swopper, a very bouncy, swinging chair with four degrees of freedom. I like it more than an exercise ball since the height and spring tension are adjustable, and it has significantly more range of motion than the ball.

  3. That IBM VERY HIGH resulution display is very nice! Cool you keep it.
    4000×4000 resolution, i am right?

  4. What backlless stool are you use?

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>