11.07.2015 Views

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PICBASIC</strong> <strong>PLUS</strong> CompilerCURSOR 1 , 3IF Hour < 12 THEN' Check for AM or PMPRINT DEC2 DHour, ":", DEC2 Minute, ":", DEC2 Second, " AM"ELSEPRINT DEC2 (DHour-12), ":", DEC2 Minute, ":", DEC2 Second, " PM"ENDIFUpdate = 0' Clear Screen UpdateENDIFGOTO Main' Do it foreverInc_Min:' Increment MinutesMinute = Minute + 1IF Minute >= 60 THEN Minute = 0GOTO DebounceInc_Hour:' Increment HoursHour = Hour + 1IF Hour >= 24 THEN Hour = 0GOTO DebounceDec_Min:' Decrement MinutesMinute = Minute - 1IF Minute >= 60 THEN Minute = 59GOTO DebounceDec_Hour:' Decrement HoursHour = Hour - 1IF Hour >= 24 THEN Hour = 23Debounce:' Debounce and delay for 250msDELAYMS 250Update = 1' Set to Update screenGOTO C_Upd' ** Interrupt routine to handle each timer tick **Clockint:CONTEXT SAVETicks = Ticks + 1' Count the pieces of SecondsIF Ticks < 61 THEN Texit ' 61 Ticks per Second (16.384ms per tick)' One Second elapsed so Update timeTicks = 0Second = Second + 1IF Second >= 60 THENSecond = 0Minute = Minute + 1IF Minute >= 60 THENMinute = 0Hour = Hour + 1IF Hour >= 24 THEN Hour = 0ENDIFENDIFUpdate = 1' Set to Update LCDTexit: INTCON.2 = 0 ' Reset timer interrupt flagCONTEXT RESTORE84Copyright Crownhill 2001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!