43oh member, DickB, built a pendulum clock regulated to keep correct time using a MSP430. A magnet helps the software to keep track of the pendulum’s position. Two LEDs – red and green give a visual indication if the pendulum is swinging too fast or slow.
This pendulum clock is not only regulated by the pendulum, but it is driven by it. A hidden magnet in the pendulum swings past a hidden coil and induces a current. This is detected and then a current pulse is fed into the coil, creating an electromagnet that repels the pendulum to keep it moving.
You can follow his project details in this 43oh build thread.