This is something that has stumped me for a while now.
What is the best way to go about handling “Clock Input Tempo Detection”? The goal isn’t to just advance a sequence every time a GPIO pin goes HIGH. That is easy. What I find difficult is accurately syncing an internal clock to an external one.
For example, take some analog clock signal from a separate piece of hardware (ei. +5v trig/gate) as an input into an MCU GPIO, and sync an internal clock signal to it.
There are loads and loads of open source euro modules out there that do this, but I have yet to find an explanation of the concepts for coding one yourself.