Shop OBEX P1 Docs P2 Docs Learn Events
RTC — Parallax Forums

RTC

MRMR Posts: 46
edited 2009-03-19 15:53 in BASIC Stamp
Please explain the following code to me so that I can better understand the operation of the RTC.

Also how can I add a 4 digit year instead of a two digit year?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If it Stinks it is Chemistry
If it is Mushy its Biology
If it doesn't work its Physics

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-03-18 22:14
    What is it you don't understand? you need to store the year as a word to use 4 digits.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • MRMR Posts: 46
    edited 2009-03-19 07:16
    said...
    What is it you don't understand? you need to store the year as a word to use 4 digits.

    I have tried making year a word it has no effect. The Highbyte is nothing more than zeroes. For example if I want say 2009, only the lowbyte of the word is stored, "09" but the Century and Millennia are never stored in the highbyte portion of the word variable.





    said...
    LOW 6
    DIRD=hours.LOWBYTE.HIGHNIB 'Send Year to Display
    PAUSE 1/1200
    HIGH 6
    GOSUB cl

    LOW 5
    DIRD=year.LOWBYTE.HIGHNIB 'Send Decade to Display
    PAUSE 1/1200
    HIGH 5
    GOSUB cl

    LOW 4
    DIRD=year.HIGHBYTE.LOWNIB 'Send Century to Display
    PAUSE 1/1200
    HIGH 4
    GOSUB cl

    LOW 3
    DIRD=year.HIGHBYTE.HIGHNIB 'Send Millenia to Display
    PAUSE 1/1200
    HIGH 3
    GOSUB cl
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If it Stinks it is Chemistry
    If it is Mushy its Biology
    If it doesn't work its Physics
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-19 15:53
    It seems you have multiple threads on this subject which is not allowed on the forums. Please do not cross-post.

    http://forums.parallax.com/showthread.php?p=793172

    Three other duplicate posts have been removed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.