Saturday, January 29, 2011

First release of the Wise Clock 3 software

The routine work of porting the "Wise Clock 2" code to the new "platform" (namely the new 3216 bicolor display) went well. Most of features worked right off the bat. Some coordinates had to be adjusted in order to center the text (time etc) on the larger display. These adjustments could have been avoided if the original code used calculations starting from X_MAX and Y_MAX. Ideally, just by changing these two values, the code should have worked.

The source code is available for download here. It compiles with Arduino IDE 21, with target set to "Sanguino" (see here how you add it to Arduino IDE).

Beside from the porting, I added a new class for "Pong clock" and also a few features (and bug fixes) related to the "big clock", courtesy of Ruud (a belated thanks!).

The "Pong clock" feature, maybe a "first" in multiple colors, is shown in the video below. The code was copied and adapted from Nick's Pong clock.



The "Big clock" feature mentioned previously allows the user to display the time with a selected big font from a few given choices. This was added by Ruud, who also captured it in this video (for Wise Clock 2).



His nice idea is to show the time, round robin, with different fonts, then allow users to select their choice by clicking the "Plus" button.


The current TODO list includes:
  • displaying the temperature from DS3231;
  • set date (day, month, year) from buttons (currently it can be set only from SD card);
  • change the time colors to indicate the proximity to the moment the alarm goes on (similarly to IllyClock);

Related posts:

4 comments:

  1. Within your code I see your DisplayTime function where you display the time. I'm just curious how do you specify colors with the ht1632_putchar function? How are the colors changed using the ht1632 library?

    ReplyDelete
  2. The last parameter of the function putchar (as fasr as I remember without looking at the code) is color.

    ReplyDelete
  3. this is putchar


    void ht1632_putchar(int x, int y, char c)
    {
    // fonts defined for ascii 32 and beyond (index 0 in font array is ascii 32);
    byte charIndex;

    // replace undisplayable characters with blank;
    if (c < 32 || c > 126)
    {
    charIndex = 0;
    }
    else
    {
    charIndex = c - 32;
    }

    // move character definition, pixel by pixel, onto the display;
    // fonts are defined as one byte per row;
    for (byte row=0; row<8; row++)
    {
    byte rowDots = pgm_read_byte_near(&myfont[charIndex][row]);
    for (byte col=0; col<6; col++)
    {
    if (rowDots & (1<<(5-col)))
    ht1632_plot(x+col, y+row, 1);
    else
    ht1632_plot(x+col, y+row, 0);
    }
    }

    Does each color have a different character set?

    ReplyDelete
  4. karl,
    You are right. I am mixing things up, since I am still working on developing this software. I think I was referring to the (un-released) version on my local disk. I looked again at the code that is already published (the above mentioned zip) and there is another function that takes color, and that is ht1632_putSmallChar.
    In the version I am working on, I already modified ht1632_putchar to take color as parameter. Sorry for the confusion.

    ReplyDelete