Friday, April 16, 2010

New features in the latest "Wise Clock 2" software

A week ago I received a version of the Wise Clock 2 code, improved and enhanced by MarkS. This library is posted here as well (together with the others, for historical reasons, let's say).

The new features implemented by Mark are:
  • ability to set the time through the buttons (instead of only through teh time.txt file on the SD card) ;
  • when setting the time, either current or alarm, the part (hours or minutes) being set is blinking;
  • time is displayed in either 12 or 24 hour format, as chosen through a menu option.
Mark also created a set of core files for Duino644 board, which can be used instead of the Sanguino core files.
Starting from Mark's changes, I restructured the latest code a bit, trying, in a hurry, an object-oriented approach. I also implemented a couple of new features:
  • quotes.txt now allows for lines to be commented out, so they don't get displayed;
  • a personalized message (e.g. "Happy birthday!", "Merry Christmas"), defined by the user in a file on SD card, can now be displayed between quotations, similar to the date.
This latest "Wise Clock 2" library is a lot of header and cpp files, some of them containing just straight C functions (HT1632.cpp, for example), some of them containing class definitions.
In the new library, Wise4Sure.pde has become very light and streamlined. The clock's functionality is now "encapsulated" in aptly named (I hope) files. Macrodefinitions are now scattered through the files, somewhat intuitively. For example, the macro _GREEN_DISPLAY_ is now found in HT1632.h file, which only deals with the display. (The ht1632 code is still the old bunch of C functions, no class at the moment.)
The OO Wise Clock 2 library can be downloaded from the same place as the others, here.


  1. I get an error:

    C:\Program Files\arduino-0018\libraries\WiseClock2April2010\Sound.cpp: In function 'void soundAlarm()':

    C:\Program Files\arduino-0018\libraries\WiseClock2April2010\Sound.cpp:60: error: 'tone' was not declared in this scope

    C:\Program Files\arduino-0018\libraries\WiseClock2April2010\Sound.cpp: In function 'void beep()':

    C:\Program Files\arduino-0018\libraries\WiseClock2April2010\Sound.cpp:75: error: 'tone' was not declared in this scope

    Hmm, any ideas? I have modified my old board to suit the changes for the new software. The old software also did not want to work correctly although I think that might have been the TV remote becuase none of the remote functions wanted to work right.

  2. Copy Tone.cpp from hardware/arduino/cores/arduino to hardware/arduino/cores/sanguino, similar to (as I believe you did) main.cpp.

  3. Yes, I recently messed up my sanguino folder and was not sure if I had got eveything back to normal. Maybe a good plan to use the duino644 core now though :)

  4. Just another comment, maybe the tone library wants to be pre-loaded into the duino644 core as it is not there either and has to be copied in.