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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/19/06 19:45
Read: times


 
#114574 - clock
hallo

I'm trying to build a clock with alarm and stopwatch, using a 8031 and coding it in C.

I have connected a lcd and a hex keypad on it and both is working perfect, I have a menu and this I can access, as well as the stopwatch is working.

The problem I have is when I try to set the time and the alarm the values doesn't update accordingly.

the normal output is:
00:00
when i press the key i defined it outputs like this,
10:00,then 11:00
then 11:10
then
11:11 and then the whole progam hangs.

at the moment i tried to define a while loop to read between the key and then to read the key, but apparently this is not working.

//////////////////////////////////////////////////
ReadKeyboard();
while(key > 0x32 ){error();ReadKeyboard();}
while(key < 0x30 ){error();ReadKeyboard();} //1ste
if (key==0x32){hourset1=1;}
time();
/////////////////////////////////////////////////////

the readkeyboard() is my keyboard routine and error() is for anything outside the loop and time is to set the time() on the display.

could the problem lie here or mayby in the time routine?

I am open to suggestions to try this different.

Thanks

List of 6 messages in thread
TopicAuthorDate
clock            01/01/70 00:00      
   program            01/01/70 00:00      
   I applaud - someone will help you I'm su            01/01/70 00:00      
      thanks            01/01/70 00:00      
   Need full picture            01/01/70 00:00      
   While loop            01/01/70 00:00      

Back to Subject List