This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

modify getkey

Hi everybody. I've a question.
I must modify the standard getkey function:

#include <reg51.h>
char _getkey () {
char c;

while (!RI);
c = SBUF;
RI = 0;
return (c);
}

to know if it receives something by RS232 in 30 sec. If in this time i don't receive anything i must return an error.
My problem is how to know if 30 seconds are passed.

Thanks everybody.

0