I guess it’s sort of the equivalent of “Hello World” for graphical displays by now.
This is my code for it:
It even includes a blinking colon! :)
There’s a separate header file with the ten bitmaps used for each digit.
Here is a copy of the modified ST7565 code I use.
This clock runs on the ATmega’s 16 MHz clock, which is only accurate to about 0.5% with a ceramic resonator. More importantly, this clock has no notion of real time – it just starts counting when turned on. The value it starts from uses a funky trick available in RTClib: it’s set to the compile time of the sketch … this is actually not a bad choice during development. But for real use, you’ll need to add an RTC Plug or some other means of obtaining the time (such as a DCF77 receiver, if you’re in Europe).
Anyway. At least now you can see that it really is a graphical display.