I got a request, to design and build an electronic metronome. You can find several on the market, but the problem it is ether producing voice or the classical mechanical metronome. The requirement here was a visual effect. To be precise four LEDs for 4/4 beat. It is required for drumming where you have no chance to hear the clicking (or maybe just through headphones).
So the idea:
- Pick an MCU (in my case it is an ATTINY85)
- A three digit LED display to see the beats per minute
- Two buttons to change the speed
- Four LEDs (in my case four RGB LEDs to be able to change the color from code)
- Power Supply, and the usual things needed for such circuit.
If you check the things above, you can quickly realize, that there is not a chance to drive the things above from an ATTINY85.
Here come into the picture an article I wrote earlier: http://pakahuszar.blogspot.hu/2018/01/tm16xx-arduino-library.html
The library I wrote for the Titan Microelectronics display drivers originally made for this project. So you can add a TM1637 to the picture above. It able to drive 6x8 LED segments, plus read 2x6 buttons. It is more than enough for LEDs, display, and the buttons.
After writing the library, the actual code of the Metronome was quite simple.
First I built the whole thing on breadboard, but using an Arduino UNO instead of the ATTINY85: