Have not had the time to do my little USB MIDI footswitch guide.
I used an Arduino Uno because it is the cheapest microcontroller I can get over the shelf here in Oslo. But using a teensy is probably a lot easier, since Teensy has support out of the box for being a USB-device(hence not needing the firmware flashing).
The guide I followed is basically this for the Arduino/mechanical building parts:
http://www.witchmastercreations.com/arduino-simple-midi-footswitch/
And this as a guide on how to flash the firmware on your Arduino(you need to do this on an UNO to get USB-midi support, HIDUINO does this):
https://www.arduino.cc/en/Hacking/DFUProgramming8U2
then:
So first you upload your footswitch code with the Arduino IDE, and then you flash the HIDUINO firmware onto the UNO by resetting it(see the Arduino guide).
When I have the time I’ll try to compile this into a more simple guide, but this is at least a starting point for some?