Posts

Showing posts from May, 2025

FSM library

Image
I did a little embedded project recently.  Years ago I bought a binary coded decimal clock which no longer works, and I thought I could replace it with one I built myself.  (In reality this was simply an excuse to play with programming a Raspberry Pi Pico.) Broken BCD clock (left) and home grown replacement (right).  The LEDs are in 6 columns and represent time in hh:mm:ss format, with each decimal digit represented in binary. During the project I realised I needed to create a little Finite State Machine to enable setting of the time using the bootsel button.  So I searched around on the internet and found tens of different libraries, but each with its own drawbacks. Some required a wizard executable to auto-generate code which you then edit, which has the drawback that if you change the input to the wizard you then need to manually merge new auto-generated code with your changes.  Other libraries, had this strange thing where each state had its own "enter" and...