Alpha Clock 5 – seconds spinner

Home Evil Mad Scientist Forums Clock Kits Alpha Clock 5 – seconds spinner

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #20178
    wbp
    Participant

    I like the “seconds spinner” in the A5 clock, but wanted a little more resolution.  Here’s the resulting code:

    1) set 2 values based on current seconds:
      byte temp1, temp2;  // wbp
        byte segs1[] = { 15, 15, 16, 16, 5, 5, 17, 17, 8, 8, 9, 9, 4, 4, 14, 14};  // wbp
        byte segs2[] = { 0,  16,  0,  5, 0, 17, 0,  8, 0, 9, 0, 4, 0, 14, 0, 15};  // wbp
        temp1 = segs1[(SecNow*4)/15];  // wbp
        temp2 = segs2[(SecNow*4)/15];  // wbp
    2) display:
            a5loadOSB_Segment (temp1, a5_brightLevel);  // wbp
            if (temp2 > 0)  // wbp
              a5loadOSB_Segment (temp2, a5_brightLevel);  // wbp
    Enjoy!
    William
    • This topic was modified 6 years, 7 months ago by Windell Oskay.
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.