AW: [En-Nut-Discussion] kbhit

Oliver Schulz olischulz at web.de
Sat Mar 18 19:04:55 CET 2006


Hi Thorsten,

Of course, there is a function kbhit(). Simply include stdio.h
Kbhit() test the stdin standard file pointer.

Regards,
Oliver. 

> -----Ursprüngliche Nachricht-----
> Von: en-nut-discussion-bounces at egnite.de 
> [mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Hugo Simon
> Gesendet: Dienstag, 14. März 2006 23:12
> An: Ethernut User Chat (English)
> Betreff: [En-Nut-Discussion] kbhit
> 
> 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
> 
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> 




More information about the En-Nut-Discussion mailing list