Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/26/10 04:52
Read: times


 
#178326 - Changing the Count
Responding to: ???'s previous message
The easiest thing to do for the counter is to change it so that it directly counts in minutes and seconds. Let us say that you have the timer interrupt happening at every 10 milliseconds. That would be equivalent to 100 times per second. Add a counter variable that counts 100, 99, 98 and down to 0 and wrap back to 100 again. Each time this cycles from 0 back to 100 you additionally increment (or decrement) the seconds value that you've got in another variable. When the seconds value gets to 59+1 (or 0-1) then reset the seconds to 0 (or 59) and at that moment then increment (or decrement) the minutes value.

To display the binary minutes or seconds values make yourself a small subroutine that accepts a binary value and displays it as two ASCII decimal digits in the human readable format.

Michael Karas


List of 4 messages in thread
TopicAuthorDate
i need help in 89c51 & LCD            01/01/70 00:00      
   What to modify....            01/01/70 00:00      
      thnx Michael            01/01/70 00:00      
         Changing the Count            01/01/70 00:00      

Back to Subject List