Page 1 of 1

problem with keyboard code

Posted: Fri Jun 07, 2002 11:00 pm
by LarsH
Hi,
can anybody here help me with this code, and say me what is wrong. My Programm
does not go in the loop.

unsigned char keyb(void)
{  
unsigned char taste,taste2;
writeln ("Keyboard test");
while (taste==taste2)
  {
   taste2=inportb(0x60);
   writeln("Wir sind in der Schleife");
  }
writeln("Taste gedrückt");              
}

Lars

RE:problem with keyboard code

Posted: Fri Jun 07, 2002 11:00 pm
by J.
Uhm... nowhere in your code do you initialize 'taste'
No good can come of that :)

Jeff

RE:problem with keyboard code

Posted: Fri Jun 07, 2002 11:00 pm
by Stefan
taste and taste2 must be initializaed with the same value to enter your loop!

RE:problem with keyboard code

Posted: Sat Jun 08, 2002 11:00 pm
by LarsH
Now I initializaed it, but now the computer reboot after a few seconds, or if there no textoutput in the loop, the loop were exist after a half seconds.

RE:problem with keyboard code

Posted: Sat Jun 08, 2002 11:00 pm
by Tim Robinson
You're better off installing a handler for IRQ 1 and using inportb(0x60) in there.