0

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.


Make a robot friend with Adafruit’s CRICKIT – A Creative Robotics & Interactive Construction Kit. It’s an add-on to our popular Circuit Playground Express, FEATHER and other platforms to make and program robots with CircuitPython, MakeCode, and Arduino. Start controlling motors, servos, solenoids. You also get signal pins, capacitive touch sensors, a NeoPixel driver and amplified speaker output. It complements & extends your boards so you can still use all the goodies on the microcontroller, now you have a robotics playground as well.

Join 7,500+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython in 2018 – Python on Microcontrollers is here!

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!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/


Maker Business — Rethink Robotics closes shop. Long live collaborative robots #makerbusiness

Wearables — Zip it up

Electronics — Serial overkill

Biohacking — Biohacking Resources – Books, Talks and Podcasts

Python for Microcontrollers — CircuitPython @ Hackaday SuperCon #ICYMI @circuitpython @micropython @ThePSF #Python

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.