I am making a program in which i have an infinite loop. I used kbhit() to detect whether a key is pressed or not. I am also using delay in the loop. So the problem is if i press the key i have to wait for the time given in delay function to perform kbhit() function actions.....
while(1)
{
delay(1000);
if(kbhit())
{
//
//
//
//
}
}
//now i have to wait 1000ms to execute kbhit()'s code how to remove this problem..
Thanks in advance....