Elapsed time routine for use with clock clip?
Scott4
Posts: 45
Can someone point me to a routine to compute elapsed time to use with·one of the·clock chips that presents time in BCD format? -Scott
Comments
I am not concerned about crossing a day boundary as I will not be flying more than 4 hours or at night. So I am just looking to determine the hours and minutes from start to stop.· -Scott
Stop········ 1:30 pm
Start·······11:59 am
··············· 1:31 elapsed time
To convert two BCD digits (like the hours and minutes bytes) to binary do:
binary = (BCD >> 4) * 10 + (BCD & $F)
Obviously, if you have the hours in binary, you multiply by 60 to get minutes which you add into the minutes in binary to get a time of day in minutes.
Post Edited (Mike Green) : 2/15/2010 8:55:02 PM GMT