OK, whilst the RTC is working fine with just reading and writing RTCHours and RTCMin, I'm having issues converting the time into minutes so I can use the variable Counter1 to store that value which is then used in the logic within my code to trigger case statements.
For example 14:00 hrs would equate to 840 minutes as the counter is reset to 00:00 at midnight. 14 * 60 = 840. 14:01 would thus be 841 etc
I've tried the following
But using this 13:57 gives a value of 784, when it should be 837.... anyone have any suggestions ?Code:If RTCHour.6=1 then CounterA=(RTCHour>>4)&$01 ' Work-Out 12 or 24 hour Display for Hours else CounterA=(RTCHour>>4)&$03 endif CounterA=CounterA*10+(RTCHour&$0F) ' Display Hours appropriately for 12 or 24 hour Mode If RTCHour.6=0 then LCDOut $FE,$D4,#CounterA else LCDOut $FE,$D4,#CounterA Dig 1,#CounterA Dig 0 endif LCDOut ":",#(RTCMin>>4)&$0F,#RTCMin&$0F," " MM=(RTCMin>>4)&$0F+RTCMin&$0F Counter1 = (counterA*60)+MM




Bookmarks