Hello everyone.
First of all i apologize if the forum section is wrong for my question.
So, i have strange problem with using PS2 keyboard on a TV with Arduino Uno.
Those are the libraries that a use.
http://playground.arduino.cc/Main/TVout
http://playground.arduino.cc/Main/PS2Keyboard
My hardware works just fine, the wiring of the hardware is based on the libraries.
The problem itself is that 1 out of 3 characters is displaying wrong on the TV. Doesn’t matter how fast i type.
This is the main sketch code:
#include <TVout.h>
#include <fontALL.h>
#include <PS2Keyboard.h>
const int DataPin = 4;
const int IRQpin = 3;
TVout TV;
PS2Keyboard keyboard;
void setup() {
delay(1000);
TV.begin(PAL,184,72);
TV.select_font(font6x8);
delay(1000);
keyboard.begin(DataPin, IRQpin);
}
void loop() {
if (keyboard.available()) {
// read the next key
char c = keyboard.read();
// check for some of the special keys
if (c == PS2_ENTER) {
TV.print("\n");
} else if (c == PS2_TAB) {
TV.print("[Tab]");
} else if (c == PS2_ESC) {
TV.print("[ESC]");
} else if (c == PS2_PAGEDOWN) {
TV.print("[PgDn]");
} else if (c == PS2_PAGEUP) {
TV.print("[PgUp]");
} else if (c == PS2_LEFTARROW) {
TV.print("[Left]");
} else if (c == PS2_RIGHTARROW) {
TV.print("[Right]");
} else if (c == PS2_UPARROW) {
TV.print("[Up]");
} else if (c == PS2_DOWNARROW) {
TV.print("[Down]");
} else if (c == PS2_DELETE) {
TV.print("[Del]");
} else {
delay(500);
TV.print(c);
}
}
}
Also when a key is pressed, TV is flickering like there is somesort of noise in the signal.
I know this problem can be fixed with adding aditional Arduino for control of the keyboard, but i want to do it with 1 Arduino.
Any ideas about that?
Thanks in further.