This beats-per-minute calculator is a quick and easy project using the Adafruit Trinket microcontroller board and 7-segment LED Backpack.
You: tap the button in time with music.
Trinket: reports the corresponding beats-per-minute.
Parts you’ll need:
- Adafruit Trinket (either the 5V or 3.3V variety)
- 7-segment LED Display Backpack (any color, 0.56" size, not 1.2")
- Momentary "normally open" pushbutton
- Breadboard, jumper wires, USB cable (A to mini B)
If this is your first time using Trinket, work through the Introducing Trinket guide first; you need to customize some settings in the Arduino IDE. Once you have it up and running, you’ll then install the following libraries:
- Adafruit_LEDBackpack
- Adafruit_GFX and Adafruit_BusIO (required by Adafruit_LEDBackpack, even though we’re not doing graphics)
Installing Arduino libraries is a frequent stumbling block. If this is your first time, or simply needing a refresher, please read the All About Arduino Libraries tutorial.
Schematic
If using a solderless breadboard, first install row pin headers on both your Trinket board and the LED Backpack. The backpack requires soldering the LED display to the board…follow the Adafruit LED Backpacks guide and make sure it’s lined up the right way!To assemble the project, only six connections are needed:
- Connect Trinket’s 5V (or 3V) pin to + on the LED backpack and one leg of the pushbutton.
- Connect the opposite leg of the pushbutton to Trinket pin #1.
- Connect Trinket’s GND pin to – on the backpack.
- Connect Trinket Pin #0 to D (data) on the backpack.
- Connect Trinket Pin #2 to C (clock) on the backpack.
For simplicity’s sake we’re using the USB connection for power. For portable use, an optional battery pack can be connected to the Trinket’s BAT and GND pins.
Text editor powered by tinymce.