Originally Posted by
richard
I have found that inline math for lcdout cmd on a pic16 turns to crap, serout2 may have the same issues
you probably need to do the math first then print result
i would do it this way
hh=hh+3 ;utc+3
hh=hh//24 ;REALLY SHOULD ADD A DAY TO DATE TOO IF day changes
serout2 lcd,32,[$73,$00,$04,$00,$FF,$E0," TIME: ",dec2 hh," :",dec2 mm," :",dec2 ss,$00]
pause 100
Richard, really appreciate your help and time.
Placing the math
Code:
hh = hh +3
hh = hh//24
before the actual command
Code:
serout2 lcd,32,[$73,$00,$04,$00,$FF,$E0," TIME: ",dec2 hh," :",dec2 mm," :",dec2 ss,$00]
it solves the time UTC to local time, and the time when goes at 24 then aytomatically shows 00:
Now i'm working on that point when time is 23:59:59 at the next second to change the date.
As i think,it supose to be like that:
Code:
if hh = 23 : mm = 59 : ss = 59
then DAY = DAY +1
But then when the Month has only 30 days or 28, we need to specify each month in order to fix the right values and set the parameters.
Bookmarks