Get_Time: I2Cread datapin, clockpin, $d1, 0, [sec,minute,hour,day,date,month,year] if display then hserout [12] ' Clear screen if display then hserout [hex2 month," / ",hex2 date," / 20",hex2 year," ",hex hour,":",hex2 minute,":",hex2 sec] ' Hex decimal numbers for clock display, must be converted to decimal to be useful. second = (sec >> 4)*10 + (sec & $F) ' second = (sec.HIGHNIB*10+sec.LOWNIB) time = ((hour >> 4)*10 + (hour & $F))*60 + (minute >> 4)*10 + (minute & $F) ' Number of minutes since midnight.




Bookmarks