[En-Nut-Discussion] kbhit

Hugo Simon hugo.simon at gmx.de
Tue Mar 14 23:12:22 CET 2006


Hi,

is there something like a kbhit function. For testing reasons I want to
built a function that pulses a Portpin until the user presses a key. Like
this:

void test(void)
{
  puts("Pulsing PORTD Bit0");
  do
  {
    pulsebit(PORTD,0);
    NutThreadYield();
  } while (!kbhit());
  getch();
}

If there is no kbhit the only method I see is to create an extra thread to
do the pulsing. But I find this much more complicated.

Thanks
Thorsten




More information about the En-Nut-Discussion mailing list