this may be better
Code:If(PortC.5 = 1) & (PortC.6 = 1) then Pause 1500 If (PortC.5 = 1) & (PortC.6 = 1) then 'IF hourly mode = AM I2CRead SDApin,SCLpin,$D0,$02,[RTCHour] temp1 = ((RTCHour>> 4) * 10) + (RTCHour& $0f) , to binary if RTCHour.6=1 then ' 12h mode if RTCHour.5=1then temp1=temp1+12 ' pm else if temp1 > 12 then temp1=temp1-12 endif rtcHOUR = ((temp1 / 10) << 4) + (tEmp1 // 10) ' to bcd RTCHour.6 = ! RTCHour.6 ' set/reset 24h mode I2cwrite SDApin,SCLpin,$D0,$02,[RTCHour] endif endif




Bookmarks