I know this has been done before with MSP430, Arduino, and Raspberry Pi but I thought I would make one too. The one thing I wanted to do differently with mine is have a sweep second hand instead of a step second hand.
The PWM range is 0-65500 and using some math I divided that value by 60 to get 1091.6667 repeating. The libraries from Adafruit only accept whole values so I convert that to int(1091.6667). That’s for each second with a time.sleep(1). Then it is just a simple matter of dividing it down by half until I get a smooth sweep of the seconds.
After 59 seconds have elapsed, the seconds, minutes, and hours hands are updated to the current time to keep everything in sync.
Thank you to Wilde Prints for creating the custom faces for the gauges.