Adafruit will not be shipping orders Monday May 30, 2016 for the federal holiday, Memorial Day. Orders placed after 11 AM EST Friday May 27 will go out Tuesday May 31.
0

April 18, 2012 AT 10:21 am

OLED Stylized Clock

While watching Tron for the umpteenth time, I started thinking about how data could be displayed in abstract, but still readable, ways.  The OLED display, with its crispness, seemed like a good fit for what I had in mind.  After considering a few different options, I settled on a building a stylized clock display.

I used the following parts in this project:

OLED Clock Zoomed

The blocks are drawn so that, from outside to inside, each ring represents hours, minutes, and seconds.  The current hour and minute are indicated by the empty block in each ring.  The current second is drawn as a solid block (this ends up looking like a square moving around the inside ring).  In the above picture, the time can be read as 8:23 and about 38 seconds.  The overall circuit is set up by following the wiring in the tutorial on the monochrome 128×64 OLED and plugging the RTC breakout board directly into the Arduino as shown in the DS1307 tutorial.

OLED Clock Protoboard

The main sketch file handles reading the current time and drawing the rectangles.  A second file contains the coordinates for each rectangle.  The rectangles are broken up into three arrays – hour_rects, minute_rects, & second_rects and ordered by the appropriate time value.  The advantage of this approach is that modifying the design of the clock is as easy as adjusting the values in the appropriate array entry.  The biggest downside was the increase in memory usage; I ended up keeping the arrays in program memory by declaring the arrays with the prog_uint8_t type and PROGMEM attribute:

prog_uint8_t hour_rects[12][4] PROGMEM = {
...
};

Also, reading from the arrays required the use of an appropriate function:

pgm_read_byte_near(&rectangles[i][0]);

The full source is available on github – I’d love to see what other designs for clock displays people come up with or if someone extends this to display other types of data.


Check out all the Circuit Playground Episodes! Our new kid’s show and subscribe!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground”Adafruit’s Apps!


Maker Business — “If Work Is Digital, Why Do We Still Go to the Office?”

Wearables — Stiff upper lip

Electronics — Signature required?

Biohacking — Race Nutrition – Eating a Bunch of Chemicals

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



2 Comments

  1. Very slick!

    I did a similar time display for my DOTKLOK project:
    http://www.flickr.com/photos/aom/5597209280/in/set-72157625965276784

    Each big block represents an entire hour, and each pixel making up the blocks represents 5 minutes, so the design slowly fills up over 12 hours.

  2. Thanks! 🙂

    Wow, that’s a really nice build! I like the design of the blocks filling up – has a very intuitive feel.

Sorry, the comment form is closed at this time.