vacant34
Newbie level 3
- Joined
- Nov 25, 2012
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,316
hi everybody
im am building a lcd with a keypad it also has a software clock
i have a issue with using the getkey() function in c. I want to ignore the function unless the dav changes
but what iv tried has not worked so far and the program gets stuck on getkey() and messes up the clock.
I know I could use a timer to build the clock but for know id just like to ignore the getkey() until is need it
so could i get some idea how to do this or a simple code for a clock based in the timers.
thank you
while(DAV==1);
{
getkey(key);
}
*****************************************************************/
unsigned char getkey(unsigned char key)
{
//unsigned char key;
while(!DAV);
key=P1&0x0f;
while(DAV);
return key;
}
im am building a lcd with a keypad it also has a software clock
i have a issue with using the getkey() function in c. I want to ignore the function unless the dav changes
but what iv tried has not worked so far and the program gets stuck on getkey() and messes up the clock.
I know I could use a timer to build the clock but for know id just like to ignore the getkey() until is need it
so could i get some idea how to do this or a simple code for a clock based in the timers.
thank you
while(DAV==1);
{
getkey(key);
}
*****************************************************************/
unsigned char getkey(unsigned char key)
{
//unsigned char key;
while(!DAV);
key=P1&0x0f;
while(DAV);
return key;
}