Re-Programming ClockTHREE and ClockTHREEjr

At some point, you may wish to re-program your ClockTHREE or ClockTHREEjr or maybe you are building a clock from scratch.  This post will walk you through the steps.

(Sorry, the formatting is not behaving.  Try this file if you are having trouble.)

Outline:

  1. Download and install Arduino for your target platform.  (More details can be found here.)
    • Navigate to the Arduino download site: http://arduino.cc/en/Main/Software
    • Download Arduino for your platform.
    • Unzip the file to the directory of your choice.  (We will refer to whatever directory you choose as <arduino_dir>).  I use c:\arduino\ on Windows or /home/justin/arduino/ on Linux so that (for arduino 22 for instance) the path extracted executable is c:\arduino\arduino-0022\arduino.exe on Windows or /home/justin/arduino/arduino-0022/arduino on Linux.
  2. Download and install ClockTHREE source code
    • Download the latest ClockTHREE library source code file from here: http://code.google.com/p/clockthree/downloads/list
    • Unzip the library source code file in your home directory. I use “My Documents\sketechbook\” on windows and /home/justin/sketchbook/ on linux.  We will refer to the directory you choose as <sketchbook>.
  3. Point Arduino to your newly extracted library files.
    • Start arduino (look here if you have trouble with this step)
    • Click File->Preferences to pull up the preferences menu.
    • Leave “Use external editor” unchecked if you plan on using Arduino as your editor.
    • Click the “Browse” button and navigate to your <sketchbook> directory from step 2.
    • Click “OK”.
    • Close and restart Arduino
    • Click “File->Sketchbook->libraries”.  If “ClockTHREE” is listed you’ve done well.
  4. Using a text editor, edit source code: set compile options and language
    • On or about line 55 in the file <sketchbook>/libraries/ClockTHREE/ClockTHREE.h, uncomment (for ClockTHREEJr) or comment out (for ClockTHREE) the following line.
    #define CLOCKTHREEJR // uncomment this line for ClockTHREEjr
    
    • On or about line 32 of <sketchbook>/libraries/ClockTHREE/examples/ClockTHREE_02.pde, comment out all but one of the following lines depending on language and hardware.
    // #include "english.h" // only need one language at a time
    // #include "german.h"
    #include "english_jr.h"
    // #include "german_jr.h"
    
    • On or about line 292 of <sketchbook>/libraries/ClockTHREE/examples/ClockTHREE_02.pde, comment out all but one of the following lines depending on language and hardware.
    // English faceplate = English();      // Only need one at a time
    // German faceplate = German();
    EnglishJr faceplate = EnglishJr();
    // GermanJr faceplate = GermanJr();
    
  5. Compile and upload
    • Connect the FTDI cable to ClockTHREE (mind color labels) and to your computer.
    • Click Tools->Boards->Duemilanove
    • Select USB port Tools->Serial Port (this may take some trial and error if you have several devices connected).
    • Compile and upload <sketchbook>/libraries/ClockTHREE/examples/ClockTHREE_02.pde.
      Click the arrow button, second from the right.  Right when the black message area at the bottom of the Arduino window displays the message “Binary sketch size:…” click the reset button on ClockTHREE.  The timing can be tricky so you may have to experiment. 
  6. Congratulations!  That is it.  Now you can customize the code to your hearts content!

One thought on “Re-Programming ClockTHREE and ClockTHREEjr

Leave a Reply