"PS2Keyboard Library" - Problem with LCD Output for german special Characters

rab

Member
"PS2Keyboard Library" - Problem with LCD Output for german special Characters

Hello to the Forum,

i am new to this forum, and i need your help for my following, hopefully understandable described problem, with Pauls "PS2Keyboard Library" in conjunction with a german PS/2 Keyboard.

What i want to do:
---------------------
Build a ARDUINO controlled "German Text-System with LCD-Display" to display static or random Alarm-Text, Menu-Text, etc.
- create text
- store created text in eeprom
- edit/change text on demand (characters, words, sentences)
- store edited text in eeprom
- display text during text creation on lcd-display
- display text during editing on lcd-display
- grab text fromm eeprom during runtime and display text on lcd-display

Hardware:
------------
- ARDUINO UNO
- Standard German PS/2 Keyboard
- either 16 x 2 LCD with Standard HITACHI 44780 Character Codes and Character Patterns (ROM Code: A00)
- or 20 x 2, 16 x 4, 20 x 4 LCD with Standard HITACHI 44780 Character Codes and Character Patterns (ROM Code: A00 or A02)

Software:
-----------
- ARDUINO 1.0.3 IDE
- PS2Keyboard 2.4 Library
- ARDUINO Sketch with "PS2Keymap_German"

Preparations:
---------------
First check availability for german Characters "ß", "ä", "Ä", "ö", "Ö", "ü", "Ü", "€" in LCD Character Codes and Character Patterns for ROM Code A00 and A02
ROM Code A00: http://html.alldatasheet.com/html-pdf/63673/HITACHI/HD44780/4262/17/HD44780.html
ROM Code A02: http://html.alldatasheet.com/html-pdf/63673/HITACHI/HD44780/4513/18/HD44780.html
- ROM Code A00 has characters for "ß", "ä", "ö", "ü"
- ROM Code A00 has no characters for "Ä", "Ö", "Ü" (capital Umlaute characters) and no character for "€" (EURO currencs character)
- ROM Code A02 has characters for "ä", "Ä", "ö", "Ö", "ü", "Ü"
- ROM Code A02 has no characters for "ß" (german special character) and no character for "€" (EURO currencs character)

Please note:
--------------
Since i use a 16 x 2 LCD with ROM Code A00 i have to customize my code to this LCD, which means:
- generally you can create up to 8 own characters max.
- i have to create the missing characters for "€", "Ä", "Ö", "Ü" by myself

Now create the missing characters in the ARDUINO code for "€", "Ä", "Ö", "Ü"
---------------------------------------------------------------------------------------
// create lcd-characters for german special characters
// EURO-Zeichen € (Euro currency symbol)
byte euro[8] = {
B00110,B01001,B11110,B01000,
B11110,B01001,B00110,B00000
};
// Ä-Zeichen, großes Ä (capital letter Ä)
byte A_umlaut[8] = {
B01010,B00100,B01010,B10001,
B11111,B10001,B10001,B00000
};
// Ö-Zeichen, großes Ö (capital letter Ö)
byte O_umlaut[8] = {
B01010,B01110,B10001,B10001,
B10001,B10001,B01110,B00000
};
// Ü-Zeichen, großes Ü (capital letter Ü)
byte U_umlaut[8] = {
B01010,B10001,B10001,B10001,
B10001,B10001,B01110,B00000
};

Find the LCD ROM Code A00 Addresses (in BIN) for "ß", "ä", "ö", "ü"
-----------------------------------------------------------------------------
- "ß" = 11100010 = 226
- "ä" = 11100001 = 225
- "ö" = 11101111 = 239
- "ü" = 11110101 = 245

Find the libraries key-code output for a. m. characters in the ARDUINO Serial Monitor
------------------------------------------------------------------------------------------------
// ARDUINO test snippet code for key-codes
void loop() {
if (keyboard.available()) {
// DEC code of the character
int key = keyboard.read();
....
....
// DEC character code control output for serial monitor
Serial.println(key);
delay(20);
}
}

Character dependency table
--------------------------------
char! Library Constant ! Serial Monitor Output ! LCD ROM Code A00 Addresses
-----!-------------------------------------------!-------------------------!--------------------------------------
"ß" ! #define PS2_SHARP_S 223 ! 159 ! 226
"ä" ! #define PS2_a_DIAERESIS 228 ! 164 ! 225
"Ä" ! #define PS2_A_DIAERESIS 196 ! 132 ! custom created character
"ö" ! #define PS2_o_DIAERESIS 246 ! 182 ! 239
"Ö" ! #define PS2_O_DIAERESIS 214 ! 150 ! custom created character
"ü" ! #define PS2_u_DIAERESIS 252 ! 188 ! 245
"Ü" ! #define PS2_U_DIAERESIS 220 ! 156 ! custom created character
"€" ! #define PS2_CURRENCY_SIGN 164 ! 164 ! custom created character

Attention Paul Stoffregen:
The PS2_CURRENCY_SIGN is defined as "¤", and not "€"! Is that by error or by purpose? Please explain!

In the a. m. "Character dependency table" you can see the first problem:
character "ä" and character "€" do have the same "Serial Monitor Output" (key-code 164). Consequently they collide, which results in pressing "€" key will display character "ä" instead of character "€"!

My simple function to map the key-codes (Serial Monitor Output) to the corresponding LCD ROM Code A00 Addresses
---------------------------------------------------------------------------------------------------------------
// function - get character and DEC key-code and return the
// appropriate lcd address for the german special characters/Umlaute
uint8_t germanSpecialCharacters(int c, int key) {
// check key-codes for ß(159), ä(164), Ä(132), ö(182), Ö(150), ü(188), Ü(156), €(164)
if (key == 159 || key == 164 || key == 132 || key == 182 || key == 150 || key == 188 || key == 156) {
switch(key) {
case 159:
c = uint8_t(226); // ß
return c;
break;
case 164:
c = uint8_t(225); // ä - conflicts with €-key and €-key conflicts with LEFTARROW-key
return c;
break;
case 132:
c = uint8_t(1); // Ä - conflicts with TAB-key
return c;
break;
case 182:
c = uint8_t(239); // ö
return c;
break;
case 150:
c = uint8_t(2); // Ö - conflicts with DOWNARROW-key
return c;
break;
case 188:
c = uint8_t(245); // ü
return c;
break;
case 156:
c = uint8_t(3); // Ü - conflicts UPARROW-key
return c;
break;
}
}
}

Test result:
------------
It seams, that i can control "ß" with key-code 159, "ö" (lowercase) with key-code 182, and "ü" (lowercase) with key-code 188 without conflicts. At least my tests didn't show me any collissions with other characters!

But for "Ä", "Ö", "Ü", "€", "ä" conflicts exists as following:
- "Ä" --> conflicts with TAB key (if i press TAB key "Ä" is displayed)
- "Ö" --> conflicts with DOWNARROW (if i press DOWNARROW key "Ö" is displayed)
- "Ü" --> conflicts with UPARROW (if i press UPARROW key "Ü" is displayed)
- "€" --> conflicts with LEFTARROW (if i press LEFTARROW key "€" is displayed)
- "€" --> conflicts with "ä" (if i press AltGr+E for "€" character "ä" will be displayed instead of "€")

Summary
-------
The character dependency between library key-code for "ß", "ö", "ü" output and ROM Code A00 seems to be OK. Mapping 159 to 226 for "ß", 182 to 239 for "ö", and 188 to 245 for "ü" seems to be OK. So far i didn't find any character conflicts.

The custom created charaters for "Ä", "Ö", "Ü", "€" will be displayed correctly too, but they have conflicts as a. m. with other keys, which means:
- the "PS2Keyboard" library produces for the concerned characters the same key-codes!?

Solution
--------
- for each a. m. pressed character key you need a unique key code, which only exists once, no matter which other key on the german ps/2 keyboard one will press!

Please help to find the german key-code problem so i can check in a "switch-case" statement for a unique key-code, and map this key-code to the appropriate lcd rom code.

Many thanks in advance, and best
Regards from Germany
rab
 
Can you please post a small but complete example program? There is an example at "Find the libraries key-code output for a. m. characters in the ARDUINO Serial Monitor", but it is not a complete program I can run here for testing.

Also, for the sake of troubleshooting, let's just focus on the PS2Keyboard portion for now, ok? I know your project involves a LCD and the LiquidCrystal library, but 2 problems at the same time makes this much more difficult. Let's just look at the keyboard part.

Please post a small but complete sample program. I will run it here, looking for this:

But for "Ä", "Ö", "Ü", "€", "ä" conflicts exists as following:
- "Ä" --> conflicts with TAB key (if i press TAB key "Ä" is displayed)
- "Ö" --> conflicts with DOWNARROW (if i press DOWNARROW key "Ö" is displayed)
- "Ü" --> conflicts with UPARROW (if i press UPARROW key "Ü" is displayed)
- "€" --> conflicts with LEFTARROW (if i press LEFTARROW key "€" is displayed)
- "€" --> conflicts with "ä" (if i press AltGr+E for "€" character "ä" will be displayed instead of "€")
 
OK Paul, here is my simple test program - please skip the the lcd part!

please note:
the libraries relevant key-code output you will find in the loop-function. have a look there at:

// DEC character code control output for serial monitor
Serial.println(key);
...
...
// DEC code of the character
int key = keyboard.read();

<<< --- Begin of my test program --- >>>

/* PS2Keyboard library, International Keyboard Layout Example
http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html

keyboard.begin() accepts an optional 3rd parameter to
configure the PS2 keyboard layout. Uncomment the line for
your keyboard. If it doesn't exist, you can create it in
PS2Keyboard.cpp and email paul@pjrc.com to have it included
in future versions of this library.
--------------------------------------------------------------------
Test Program for displaying german special characters/Umlaute
on a 16 x 2 LCD-Display
*/

// include the PS2-Keyboard Library code:
#include <PS2Keyboard.h>
// include the LCD Library code:
#include <LiquidCrystal.h>

// create lcd-characters for german special characters
// EURO-Zeichen € (Euro currency symbol)
byte euro[8] = {
B00110,B01001,B11110,B01000,
B11110,B01001,B00110,B00000
};
// Ä-Zeichen, großes Ä (capital letter Ä)
byte A_umlaut[8] = {
B01010,B00100,B01010,B10001,
B11111,B10001,B10001,B00000
};
// Ö-Zeichen, großes Ö (capital letter Ö)
byte O_umlaut[8] = {
B01010,B01110,B10001,B10001,
B10001,B10001,B01110,B00000
};
// Ü-Zeichen, großes Ü (capital letter Ü)
byte U_umlaut[8] = {
B01010,B10001,B10001,B10001,
B10001,B10001,B01110,B00000
};

// PINs for the PS/2 keyboard
const int IRQpin = 2; // Clock
const int DataPin = 3; // DATA

// create an instance of keyboard object
PS2Keyboard keyboard;
// initialize the LCD-Library with the numbers of the interface pins
LiquidCrystal lcd(7,8,9,10,11,12);
// pin 13 will control the backlight
int backLight = 13;

void setup() {
pinMode(backLight, OUTPUT);
// turn backlight on
digitalWrite(backLight, HIGH);
//keyboard.begin(DataPin, IRQpin, PS2Keymap_US);
keyboard.begin(DataPin, IRQpin, PS2Keymap_German);

Serial.begin(9600);

// generating german special characters
lcd.createChar(0, euro); // €
lcd.createChar(1, A_umlaut); // Ä
lcd.createChar(2, O_umlaut); // Ö
lcd.createChar(3, U_umlaut); // Ü

// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
}

void loop() {
if (keyboard.available()) {
// character
char c = keyboard.read();
// DEC code of the character
int key = keyboard.read();
// set the cursor to column 0, line 1
lcd.setCursor(0, 1);
// dipsplay on LCD all characters, incl. german special
// characters and Umlaute - ß, ä, Ä, ö, Ö, ü, Ü
// LCD-Ausgabe aller Zeichen, inkl. deutscher
// Sonderzeichen und Umlaute - ß, ä, Ä, ö, Ö, ü, Ü
lcd.write(germanSpecialCharacters(c, key));
delay(20);
// character control output for serial monitor
//Serial.println(c);
// DEC character code control output for serial monitor
Serial.println(key);
}
}

// function - get character and DEC key-code and return the
// appropriate lcd address for the german special characters/Umlaute
uint8_t germanSpecialCharacters(int c, int key) {
// check key-codes for ß, ä, Ä, ö, Ö, ü, Ü
// prüfe auf deutsche Sonderzeichen und Umlaute - ß, ä, Ä, ö, Ö, ü, Ü
if (key == 159 || key == 164 || key == 132 || key == 182 || key == 150 || key == 188 || key == 156) {
switch(key) {
case 159:
c = uint8_t(226); // ß
return c;
break;
case 164:
c = uint8_t(225); // ä
return c;
break;
case 132:
c = uint8_t(1); // Ä
return c;
break;
case 182:
c = uint8_t(239); // ö
return c;
break;
case 150:
c = uint8_t(2); // Ö
return c;
break;
case 188:
c = uint8_t(245); // ü
return c;
break;
case 156:
c = uint8_t(3); // Ü
return c;
break;
}
}
}

<<< --- End of my test program --- >>>

Hope this is what you asked me for.
Best Regards from Germany.
rab
 
I deleted all the LCD stuff (you could have done this.... rather than making me do it)

Here's what's remaining:

Code:
// include the PS2-Keyboard Library code:
#include <PS2Keyboard.h>

// PINs for the PS/2 keyboard
const int IRQpin = 2; // Clock
const int DataPin = 3; // DATA

// create an instance of keyboard object
PS2Keyboard keyboard;

void setup() {
  keyboard.begin(DataPin, IRQpin, PS2Keymap_German);
  Serial.begin(9600);
}

void loop() {
  if (keyboard.available()) {
    // character
    char c = keyboard.read();
    // DEC code of the character
    int key = keyboard.read();
    Serial.println(key);
  }
}

Before I try to use this, I have one question. Why do you use keyboard.read() twice?
 
sorry paul,

because the lcd part does not bother the other code you asked for, i thought it's better for your understanding to have my complete test code. if you load my supplied test code without the lcd hardware connected, the ARDUINOs Serial Monitor Output will be the same as with connected lcd hardware!

In the loop() part i use keyboard.read() twice as following:

// character
char c = keyboard.read();
// DEC code of the character
int key = keyboard.read();

because variable c then contains the character, and variable key then contains the dec number for that character (key-code) from your library.

With

// character control output for serial monitor
//Serial.println(c);
// DEC character code control output for serial monitor
Serial.println(key);

in the loop() part i then can check the character in variable c and the corresponding key-code in variable key supplied by your library in ARDUINOs Serial Monitor.

Furthermore i use both variables c and key for the LCD-Part in my function germanSpecialCharacters(int c, int key) with a "switch - case" statement in the loop() part to:
- check the pressed key (key-code in variable key)
- and to map the pressed key (character in variable c) to the corresponding lcd ROM Code A00 address

Please note:
this is just my simple test program to understand what's going on. Of course this is not my final solution to run the system!

Best Regards from Germany.
rab
 
Last edited:
Hello Forum,
Hello Paul,

another try to make the problem clear. Following please find my test-sketch without any lcd-part. This time i took Pauls original test-sketch from
http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html
and adapted it to my german ps/2 keyboard hardware.
Code:
/*  PS2Keyboard library, International Keyboard Layout Example.
    Test-Sketch to show the problem of none-standard ASCII-Code characters
    in the german version of the PSKeyboard Library (version 2.4). 
    
    This Sketch is the original test sketch from Paul Stoffregen found on his website
    http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html 
    adapted to my ps/2 keyboard hardware, and extended to the problematic chracters. 
*/

// include the PS2-Keyboard Library code:   
#include <PS2Keyboard.h>

// PINs for the PS/2 keyboard
const int IRQpin =  2; // Clock
const int DataPin = 3; // DATA

// create an instance of keyboard object
PS2Keyboard keyboard;   

void setup() {
  //keyboard.begin(DataPin, IRQpin, PS2Keymap_US);
  keyboard.begin(DataPin, IRQpin, PS2Keymap_German);
  
  Serial.begin(9600);
}

void loop() {
  if (keyboard.available()) {
    
    // read the next key
    char c = keyboard.read();
    
    // check for some of the special keys
    if (c == PS2_ENTER) {
      Serial.println();
    } else if (c == PS2_TAB) {
      Serial.print("[Tab]");     // Serial Monitor print out is correct
    } else if (c == PS2_ESC) {
      Serial.print("[ESC]");     // Serial Monitor print out is correct 
    } else if (c == PS2_PAGEDOWN) {
      Serial.print("[PgDn]");    // Serial Monitor print out is correct
    } else if (c == PS2_PAGEUP) {
      Serial.print("[PgUp]");    // Serial Monitor print out is correct 
    } else if (c == PS2_LEFTARROW) {
      Serial.print("[Left]");    // Serial Monitor print out is correct 
    } else if (c == PS2_RIGHTARROW) {
      Serial.print("[Right]");   // Serial Monitor print out is correct
    } else if (c == PS2_UPARROW) {
      Serial.print("[Up]");      // Serial Monitor print out is correct 
    } else if (c == PS2_DOWNARROW) {
      Serial.print("[Down]");    // Serial Monitor print out is correct 
    } else if (c == PS2_DELETE) {
      Serial.print("[Del]");     // Serial Monitor print out is correct     
 [B][COLOR="#FF0000"]   // check for some of the problematic german/european characters[/COLOR][/B]
    } else if (c == PS2_CURRENCY_SIGN) {
      Serial.print("[EURO]");  // Serial Monitor print out [COLOR="#FF0000"]should be EURO, but is ¤[/COLOR]
    } else if (c == PS2_SHARP_S) {
      Serial.print("[SZ]");    // Serial Monitor print out [COLOR="#FF0000"]should be SZ, but is Ã[/COLOR]Ÿ   
    } else if (c == PS2_a_DIAERESIS) {
      Serial.print("[ae]");    // Serial Monitor print out [COLOR="#FF0000"]should be ae, but is ä[/COLOR]
    } else if (c == PS2_A_DIAERESIS) {
      Serial.print("[AE]");    // Serial Monitor print out [COLOR="#FF0000"]should be AE, but is Ã[/COLOR]„ 
    } else if (c == PS2_o_DIAERESIS) {
      Serial.print("[oe]");    // Serial Monitor print out [COLOR="#FF0000"]should be oe, but is ö[/COLOR]
    } else if (c == PS2_O_DIAERESIS) {
      Serial.print("[OE]");    // Serial Monitor print out [COLOR="#FF0000"]should be OE, but is Ã[/COLOR]– 
    } else if (c == PS2_u_DIAERESIS) {
      Serial.print("[ue]");    // Serial Monitor print out [COLOR="#FF0000"]should be ue, but is ü [/COLOR]
    } else if (c == PS2_U_DIAERESIS) {
      Serial.print("[UE]");    // Serial Monitor print out [COLOR="#FF0000"]should be UE, but is Ü[/COLOR]
    } else if (c == PS2_DEGREE_SIGN) {
      Serial.print("[DEGREE]");// Serial Monitor print out [COLOR="#FF0000"]should be DEGREE, but is °[/COLOR]      
    } else {
      
      // otherwise, just print all normal characters
      Serial.print(c); // so far OK, but [COLOR="#FF0000"]not all key combinations tested yet[/COLOR]. 
    }
  }
}
Any idea, any helpful answer is apprechiated. Please help.
rab
 
Last edited:
Last edited:
Hello Nantonos,

thanks for your answer, but i know that there is a character code mismatch. In fact, that's the rason why the problem occurs!

In Pauls library file "PS2Keyboard.h" all the special characters are defined as extended ASCII-Code (ISO-8859-Family).
#define PS2_a_DIAERESIS 228 // german ä
#define PS2_A_DIAERESIS 196 // german Ä

But i cannot control these characters by
Code:
if (c == PS2_a_DIAERESIS) {
	Serial.print("[ae]");    // Serial Monitor print out should be ae, but is ä
} else if (c == PS2_A_DIAERESIS) {
	Serial.print("[AE]");    // Serial Monitor print out should be AE, but is Ä
}
because variable c does not contain 228 or 196 as expected. I need to know which DEC-Value (integer) is associated to variable c for each pressed key. This calculation is somewhere "hidden" in Pauls "PS2Keyboard.cpp" file. It would be very nice and helpful, if Paul could help and tell me/us what to do, or where and how to recode the characters so they can be controlled by the ARDUINO µC and displayed on a standard 44780 LCD.

I am pretty sure that Pauls Library will work if i would store the characters/texts to a SD-memory card, and that i could open the stored text on my PC within a text-program which can handle UTF-8 coded text. But my application is not a PC-application, but a machine control application.

rab
 
Try adding this in PS2Keyboard.cpp:

Code:
int PS2Keyboard::readUnicode() {
        int result;

        result = CharBuffer;
        if (!result) result = get_iso8859_code();
        if (!result) return -1;
        UTF8next = 0;
        return result;
}

and this in PS2Keyboard.h:

Code:
    static int readUnicode();

Please let me know if this solves your problem? If so, I'll publish is in the next version.
 
Hello Paul,

thanks. I added your code at the very end of "PS2Keyboard.cpp" file and at the very end of "PS2Keyboard.h" file. No change, still the same problem!
Sorry, i am not a perfect c/c++ programmer, and to avoid further misunderstandings or errors from my side please advise exactly where to add your new code fragments into the files.
On top? In the middle? At the end? In a certain function? After which line number? Do i have to delete a certain function for the new function(s), and if, which function(s) do i have to delete?

rab
 
Last edited:
You also have to start using readUnicode() in your program, instead of the normal read().

It doesn't matter where you add them, if you do not get any error. If you add it in the private section in the .h, you'll get an error that the function is private when you try to use it.
 
Hello Paul,

thanks for your answer. As you told me i placed your new code snippets as described into "PS2Keyboard.cpp" and "PS2Keyboard.h", and i even inserted the code snippets at the beginning, in the middle, and at the end of "PS2Keyboard.cpp" and "PS2Keyboard.h" files. In the "loop()" function now i start with "readUnicode()" like follwing:

Code:
void loop() {
  if (keyboard.available()) {     
    // read the next key
    char c = keyboard.readUnicode();
...
instead of using "read()" as following:

Code:
void loop() {
  if (keyboard.available()) {     
    // read the next key
    char c = keyboard.read();
...

The compiler accepts the old function "keyboard.read()", but not the new function "keyboard.readUnicode()"! With "keyboard.readUnicode()" function the compiler shows following error message:

test_ps2_ohne_lcd.ino: In function 'void loop()':
test_ps2_ohne_lcd:31: error: 'class PS2Keyboard' has no member named 'readUnicode'

Sorry Paul, but i am pretty sure that i misplaced the new code snippets within the .cpp and .h file. Once again, i am not a c/c++ specialist!! So please tell me exactly where to place your new code snippets within the .cpp and .h file, and don't leave a c/c++ layman like me with answers which could be easily misinterpreted. Thanks.

rab
 
Hello Paul,

thanks for the new files, but as i can see now, i had added the new code snippets in the same place as you did, which means, even with your new posted 2 files the problem is still the same. The compiler always ends the compilation with the error message
test_ps2_ohne_lcd.ino: In function 'void loop()':
test_ps2_ohne_lcd:31: error: 'class PS2Keyboard' has no member named 'readUnicode'
To avoid library mismatch problems i even deleted my existing "PS2Keyboard 2.4 Library" and reinstalled it, including your new posted files. But the compiler error message ist still there!

The new function "readUnicode()" is declared in "PS2Keyboard.cpp" and inserted in "PS2Keyboard.h" within the "public:" part of the class "PS2Keyboard {}"! Why the compler cannot find the new "readUnicode()" function?

rab
 
Please post a small but complete sample program.

To investigate almost any problem that results in a compiler error, I require a sample program which I can compile here to get the same error. I answer many questions daily. I simply do not have time to investigate problems with partial information. Yes, I could write a program which does this, but I have limited time and many questions to answer, and many new features to develop for many people. Investigating problems goes much faster if you post a complete sample which I can simply copy into Arduino and click Verify to see the problem.

I can also do more, with limited time, to help you and everyone else if I do not have to always write this same request, over and over, asking you to provide a complete (and hopefully minimal) sample program. Please remember this and always provide a small but complete program when you report any problem that results in a compile error, or almost any type of problem involving the software where a sample program would help!
 
Hello Paul,
please have a look at my post in this thread dated "04-13-2013, 04:12 PM" (3 days ago!). At that time i have already posted your once again asked small but complete sample program.

OK, once again, and this time as an ".ino file attachment" you will find my sample program, which ends up in the posted compiler error message. The attached ".ino file" has a german file name, and it simply means translated in english "test_ps2_without_lcd.ino".

I hope this will help to resolve the problem.
rab
 

Attachments

  • test_ps2_ohne_lcd.ino
    3.3 KB · Views: 178
I just compiled this code without any error. I could not reproduce the "test_ps2_ohne_lcd:31: error: 'class PS2Keyboard' has no member named 'readUnicode' " error you mentioned. It compiles correctly.

Here is a screenshot:

screen.png

I do not know why you are seeing that error. It does not happen here when I compile your code.
 
Ups, that's strange.

All my other sketches are compiled without any problems. Then somethimg must be wrong with my ARDUINO installation. I will uninstall my ARDUINO 1.0.3 and reinstall the new version 1.0.4. Keep you informed about the result.

rab
 
Solved the compiler problem!
Before going further to my test result of the new "readUnicode()" function, maybe it's of interest for some users to know how i have fixed this strange ARDUINO compiler problem:

My PC-System:
- windows 7 ultimate 64 Bit
- intel core i7-2600k CPU
- 16 GB RAM
- 256 GB SSD for windows operating system
- 2 TB HD RAID

What i have done:
- i uninstalled ARDUINO 1.0.3
- i deleted ARDUINOs "preferences.txt" file in the users path
- i cleaned up the windows operating system "Registry" with the software tool "CCleaner"
- i made a new installation of ARDUINO 1.0.4
- i restarted windows
- i copied the "PS2Keyboard" library with the new "PS2Keyboard.cpp" and with the new "PS2Keyboard.h" into users Sketchbook path

Please be aware, just delete ARDUINO and reinstall it didn't solve my problem! I had to delete the old "preferences.txt" file too, and i had to clean the registry, and i had to restart windows. I don't know why, and i don't know what happened to my ARDUINO 1.0.3 installation, but a. m. steps did solve my compiler problem.

OK, here is the result of the new function "readUnicode()", based on the already supplied sample test program, displayed in ARDUINOs Serial Monitor:

- first, and in contrast to the "read()" function, now each key press will result into an endless character printout (see attached .jpg screenshot)
- german characters ä, Ä, ö, Ö, ü, Ü, ß will now be printed/displayed correct, but, as already m. a., the characters will be printed in an endless line (see attached .jpg screenshot)
- instead of the EURO sign/character "€" the character "¤" will be printed in an endless line (see attached .jpg screenshot)

Before having tested the 2 new library changes with my planned lcd printout, from my point of view there are only 2 problems left (thanks to Paul):

1.) endless character printout, instead of 1 key press = 1 printed character
2.) the EURO sign "€" printout is still wrong ("¤")

Paul:
any idea how David Chochoi has solved the "€" sign problem in his french library version?

If we can fix the endless character printout and the "€" sign problem we are almost done. Then i can start to match the character "Serial Monitor" printout to the character "LCD" printout.

rab
 

Attachments

  • 170413_character_euro.jpg
    170413_character_euro.jpg
    17.5 KB · Views: 205
  • 170413_character_sz.jpg
    170413_character_sz.jpg
    20.8 KB · Views: 236
  • 170413_character_c.jpg
    170413_character_c.jpg
    18.5 KB · Views: 221
OK, here is the result of the new function "readUnicode()", based on the already supplied sample test program, displayed in ARDUINOs Serial Monitor:

first, and in contrast to the "read()" function, now each key press will result into an endless character printout (see attached .jpg screenshot)

Opps, I see the bug. Here is a new copy which should fix that problem. Please let me know how this works?

The Euro sign in the Arduino Serial Monitor is not a bug in PS2Keyboard. Arduino simply doesn't support printing that character in the serial monitor.
 

Attachments

  • PS2Keyboard.cpp
    13.4 KB · Views: 281
Thanks Paul,

with your new "PS2Keyboard.cpp" file the endless character problem is fixed! I didn't know that the "€" sign cannot be displayed within ARDUINOs Serial Monitor. So this character problem should be OK now, too.
Anyway, many thanks for your help. I will go ahead now and map the special german characters to the Standard Hitachi 44780 LCD Character ROM Code A00. If problems will occure, i will come back to this Form.

rab
 
Back
Top