In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Fred_5ms wrote: :idea: What about this. [code] ' ------------------------------------------------------------------------- ' Variables ' ------------------------------------------------------------------------- MilliSeconds VAR Byte HundredthsOfSeconds VAR Byte TenthsOfSeconds VAR Byte Seconds VAR Byte Minute VAR Byte Hours VAR Byte Days VAR Byte Weeks VAR Byte ------------------------------------------------------------------------- ' Subroutine Declarations ' ------------------------------------------------------------------------- Update_Clock SUB 0 ' ------------------------------------------------------------------------- ' Program Code ' ------------------------------------------------------------------------- Start: ' initialization code here Main: Update_Clock GOTO Main Update_Clock: INC MilliSeconds IF MilliSeconds = 10 THEN MilliSeconds = 0 INC HundredthsOfSeconds IF HundredthsOfSeconds = 10 THEN HundredthsOfSeconds = 0 INC TenthsOfSeconds IF TenthsOfSeconds = 10 THEN TenthsOfSeconds = 0 INC Seconds IF Seconds = 61 THEN Seconds = 0 INC Minute IF Minute = 61 THEN Minute = 0 INC Hours IF Hours = 25 THEN Hours = 1 INC Days IF Days = 8 THEN Days = 0 INC Weeks IF Weeks = 52 THEN Weeks = 0 ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF RETURN [/code] Something to think about anyway. :rolleyes: Hope it helps. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=358866#m359650 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)