Computing stuff tied to the physical world

The obligatory clock…

In Software on Nov 22, 2010 at 00:01

Take a Graphics Board, a JeeNode (or JeeNode USB, or JeeSMD), some code, and you get this:

Dsc 2303

I guess it’s sort of the equivalent of “Hello World” for graphical displays by now.

This is my code for it:

Screen Shot 2010 11 21 at 17.38.44

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.

  1. Cool. Can you anti-alias the bitmaps? It would probably look weird close up but I’m just interested really.

  2. You could sandpaper the front of the LCD!

    Anyway, more seriously, combine this clock (with RTC), with Bleep from yesterday (yes, will require two JeeNodes) and you have an Alarm Clock!

    I expect to see it by the end of the week ;-)

    • You can (theoretically) save one JeeNode by using fast variation of duty-cycle of the PWM + Cap to generate a sinwave. You must use a oamp or other solutions if you want a bias free wave thou. I have NOT calculated if it is possible to control the PWM block of the 328 fast enough to make audio. I used this on a much faster yC (-:

  3. May I suggest you add all the code snippets as text? I use them sometimes to learn and not all of them are also in a separate link.

  4. Ah, nice. Looks like the I found one that’s not there: https://jeelabs.org/2010/06/17/rgb-via-the-dimmer-plug/ ;) Thanks. /me is still waiting for a AC dimmer plug (nudge, nudge!)

Comments are closed.