Hi, I'm trying to use the Arduino Mega 2560 with a PS/2 keyboard and the TVout library.
Below you can see that I attached an interrupt to pin 19 which is the clock signal from the keyboard, then set pin 25 to input for the keyboard data, then I started TVout.
void setup() {
attachInterrupt(digitalPinToInterrupt(19), keystroke, FALLING);
pinMode(25, INPUT);
TV.begin(_NTSC,128,96);
TV.select_font(font6x8);
TV.println("Keyboard v3.0\nTerminal\n");
}
The interrupt runs this function:
void keystroke() {
buff[bit] = digitalRead(25); //reads current bit from keyboard
bit += 1; //advances for next bit
}
The problem is that when the Arduino is receiving data from the keyboard, the video output starts glitching and keystrokes don't register properly. Is there some way I could somehow disable video output before reading data? Or something else. Thanks in advance!