wooden-bits

Binary clock code for my 'Wooden Bits' project. The clock is designed for output to WS2812 LED matrices such as Adafruits NeoPixel or Pimoroni's Unicorn Hat. Code was developed for Arduino (bClock/) but I've ported to Raspberry Pi (raspberryPi/)

OTHER License

Stars
8
01000010 01101001 01101110 01100001 01110010 01111001  01000011 01101100 01101111 01100011 01101011
______ _                          _____ _            _    
| ___ (_)                        /  __ \ |          | |   
| |_/ /_ _ __   __ _ _ __ _   _  | /  \/ | ___   ___| | __
| ___ \ | '_ \ / _` | '__| | | | | |   | |/ _ \ / __| |/ /
| |_/ / | | | | (_| | |  | |_| | | \__/\ | (_) | (__|   < 
\____/|_|_| |_|\__,_|_|   \__, |  \____/_|\___/ \___|_|\_\
                           __/ |                          
                          |___/                           

Binary Clock

Originally made for Arduino controller in my Wooden Bits project, this is a binary clock for WS2812 LEDS that scales to any size pixel matrix. It includes a function for generating the 'snakes and ladders' arrangment of pixels, which can be used as a map reference for other functions.

Features

  • Version for Arduino/Atmega328 and Raspberry Pi.
  • Scales to any size WS2812 matrix.
  • Ability to rotate display.
  • Ability to set second indicator pulsing.
  • Quarter hour indicator fills n/quarter rows of the display blue (n is the
    quater multiple).
  • Full rainbow at midday and midnight.
  • setMatrix for sending any binary size to display; not just time.
  • initMatrixMap for creating lookup map of disaply.

For more details, see my blog post: http://wp.me/p2C0Bi-7R

Buy One!

My Shop Etsy

Requirements

Hardware

  • Arduino/atmega328 or Raspberry Pi.
  • Pixel grid, user created or Adafruit NeoPixel, Pimoroni Unicorn Hat. Should
    be connected to pin 6 on Arduino or pin 18 on rPi by default.
  • For Arduino you'll need a DS1307RTC/DS3231RTC chip, already set with the time (see
    library page).
  • There is a KiCAD PCB project, which is what I now use for clocks I sell.

Arduino Libraries

Build

Arduino

Compile using the Arduino IDE or using the Makefile. Using the makefile reqruies 'Arduino.mk': https://github.com/sudar/Arduino-Makefile

Set the number of pixels in each row and column in 'bClock.h'. The clock will automatically scale the binary bits to the pixel grid - thanks to the pixelMap generation.

You can defined a flash on seconds 'pulse_second', rotated display 'rotate' and brightness

Raspberry Pi

Compile using make then run sudo ./bClock [brightness] [pulse_second] [rotate]. Designed for Raspberry Pi and Pimoroni Unicorn Hat but code can scale to any size matrix. pixelMap generator is useful for other functions other than this code.

Open SCAD

Compile within Open SCAD and export as .dxf. The comments explain how to export the various different layout options. The designs are supplied for personal use only under Creative Commons Attribution-NonCommercial 4.0 International License.

References

John Whittington @j_whittington http://www.jbrengineering.co.uk 2014

Attribution and License

Software is

Hardware (KiCad, OpenSCAD, design exports etc.) is

I make many of my projects Open Source so others can learn as I have, but please remember to follow the license terms and attribute any derivations or code reuse. You can do this by linking back to the project or jbrengineering.co.uk. Feel free to click the donate button above if you do use the source :).

Badges
Extracted from project README
Donate License: GPL v3 License: CC BY-SA 4.0