This sketch implements a MIDI beat clock driver which can be controlled by tapping a button or pedal (such as a digital keyboard sustain pedal) connected to the Arduino. Holding the button/pedal down for 1 second stops the beat messages until a new tempo is tapped in.
The default pin setting I used for building a compact unit out of an Arduino Nano is as follows:
- External power supply (5-20V) to pins
VINandGND - Button or pedal to pins
GNDand14akaA0(used inINPUT_PULLUPmode) - MIDI DIN connector pin 2 to Arduino
GND - MIDI DIN connector pin 4 to Arduino pin
5Vthrough a 220 Ohm resistor - MIDI DIN connector pin 5 to Arduino pin
10through a 220 Ohm resistor - Status LED to Arduino pin
6(through a suitable resistor)
This sketch requires two libraries, both available for download from within Arduino:
