Hand tools and fabrication machines
The bean is programmed to send a MIDI CC message when the foot switch is depressed. Any music app or music notation app with MIDI Learn capabilities can be controlled by this message. Currently, I'm using a bean to turn pages in forScore.Assembly
First, solder the audio jack and right-angle headers to the TRS breakout.
Next, insert the TS plug from the foot switch into the audio jack. Connect the audio jack headers to pins D0 through D5 of the bean. Make sure the tip pin (T) is connected to D0 on the bean, the ring (R) is connected to D2, and the sleeve (S) is connected to D4.
The foot switch shown in the photo is an MPM PS-25, but one of the rugged Boss foot switches will also work, as will the less expensive plastic one sold by Adafruit. The polarity of the foot switch doesn't matter because its initial state is detected when the sketch starts.Programming
Upload the sketch provided to your bean.
The LED will be lit blue until the bean is connected to a host. After the bean is connected to a host, its LED will glow green when the pedal is pressed.
The bean is programmed to assign value 127 to controller number 80 on MIDI channel 11 (of 16) when the pedal is pressed, and to assign value 0 when the pedal is released. The MIDI channel and controller number are easily changed in the code.
After connecting the bean, follow the MIDI Learn instructions in your chosen music app.Twins
The included sketch will also work with a TRS insert cable connected to two foot switches, as shown in the photo below.
When connecting two foot switches, the pedal connected to the ring cable sends a control change message for controller number 81 when it is pressed and released, and the bean's LED will glow red when this pedal is pressed. The behavior of the pedal connected to the tip cable is the same as described above.Appendix: Other Parts
To use a different BLE-enabled board, follow the connection guide for your board below and upload the matching sketch.
Adafruit Feather nRF52
Connect TRS jack breakout to pins 15..10 and upload sketch nRF52FS.ino
- T => D15
- R => D13
- S => D11
Connect TRS breakout to pins 7..2 and upload sketch CurieFS.ino
- T => D7
- R => D5
- S => D3
SparkFun nRF52 Breakout
Connect TRS breakout to pins A5..A0 and upload sketch nRF52FS.ino
- T => A5
- R => A3
- S => A1