The code above did not compile since it was not complete and just pseudo code example:
the table for cyrillic should be completed for all 256 entries, the lcd needs to be instantiated etc.
You can override the putc() in the source of TextLCD to use the conversion table for each character. The printf method of TextLCD will use the internal method putc() to display every character in the string on the LCD. The string will typically have to consist of characters that each take up one byte. You need to convert the source cyrillic data entered by the user and translate that to the correct LCD font entry to show up on the display.
Here is a more complete example that waits for keyboard entries and responds to A and b by showing latin A and cyrillic b.
#include "mbed.h"
#include "TextLCD.h"
Serial serial(USBTX, USBRX);
TextLCD lcd(p10, p12, p15, p16, p29, p30); // rs, e, d4-d7
char c;
const char cyrillic[2] = {0x41,0xA0}; //conversion table between char codes from keyboard and cyrillic fonttable in controller
int main() {
while (1) {
c=serial.getc();
//table is not completely filled at the moment so make sure you dont access illegal entries
switch (c) {
case 'A': lcd.putc ( cyrillic[0] );
serial.printf("hex code cyr 0x%x\r\n", cyrillic[0]); // gives 0x41
break;
case 'b': lcd.putc ( cyrillic[1] );
serial.printf("hex code cyr 0x%x\r\n", cyrillic[1]); // gives 0xA0
break;
default: lcd.putc ('*');
break;
}
wait(1);
}
}
When the table is completed for all 256 entries you can delete the switch and simply use
c=serial.getc();
lcd.putc ( cyrillic[c] );
serial.printf("hex code cyr 0x%x\r\n", cyrillic[c]);
Could somebody port subj to mbed, please. I really need cirillic symbols.