åäö with LiquidCrystalLCD

Hello. im writing a code that needs to be in swedish, therefore i need to use "åäö".
Now, when I write out "åäö" i get something totaly different than i expected.

here is a test that only give me Test and then japanese signs on the display.
Any ideas?

 #include <LiquidCrystal.h> // for LCD display
 LiquidCrystal lcd(12, 11, 10, 9, 8, 7, 6);
 int backLight = 13;    // pin 13 will control the backlight

 String message=" Test åäö ÅÄÖ ";
  lcd.begin(20, 4);            
  lcd.setCursor(0,0);
  lcd.print(message);

You should use a LCD that has a ROM containing those characters, or make your own characters.
Most ROMs used, have Japanese (i guess) characters instead of the ones you like to have.
So it would be better to define your own characters.
If i'm not mistaking, you have 8 programmable characters so you are limited here.

I'll second what MAS3 said.
I'm not familiar with the Swedish alphabet, but if there are 8 or less non-English characters, you can create your own custom chars and keep using your current LCD.
If there are more than 8, the you will have to find an LCD which contains the Swedish alphabet.

there are only 3 extra, so i need 6(for capital and regular letters) so it would be possible to make the special signs yourself.

Anyone got a link to where i can find an example how to do this?
I have already bought 4 displays of the same kind, feels silly to toss them due to this problem:)

thank you.. found a link over how to do this:) will be fun to see if i get it to work:) problems are there to be solved! right? :smiley:

For reference for others: here is a guide over how to make your own signs:

Yes, it should be easily possible.
I use this tiny program to make my custom characters.
http://dlnmh9ip6v2uc.cloudfront.net/datasheets/LCD/Monochrome/HD44780CCGV1001.zip

I made a function that makes the ones I want. the problem is, that they can only be fitted into the first 8 slots of the chart of caracters. that means that i also have to build some clever function that searches and replaces all this chars before i print them out to the lcd.. How could would it have been if you could have changed them all? you could make your own font :slight_smile: or bricks for a game or something like that...

anyway.. if someone from sweden needs this function, here it is..

(just call the function below somewere inside your setup().)

void createSweCaracters(){

 byte AwithRing[8] = {
  B00100,
  B01010,
  B01110,
  B00001,
  B01111,
  B10001,
  B01111,
  };
  
  byte AwithDots[8] = {
  B01010,
  B00000,
  B01110,
  B00001,
  B01111,
  B10001,
  B01111,
  };
  
  byte OwithDots[8] = {
  B01010,
  B00000,
  B01110,
  B10001,
  B10001,
  B10001,
  B01110,
  };
  
  byte CapitalAwithRing[8] = {
  B00100,
  B01010,
  B01110,
  B10001,
  B11111,
  B10001,
  B10001,
  };
  
  byte CapitalAwithDots[8] = {
  B01010,
  B00000,
  B01110,
  B10001,
  B11111,
  B10001,
  B10001,
  };
  
  byte CapitalOwithDots[8] = {
  B01010,
  B00000,
  B01110,
  B10001,
  B10001,
  B10001,
  B01110,
  };
  
  lcd.createChar(1, AwithRing);
  lcd.createChar(2, AwithDots);
  lcd.createChar(3, OwithDots);
  lcd.createChar(4, CapitalAwithRing);
  lcd.createChar(5, CapitalAwithDots);
  lcd.createChar(6, CapitalOwithDots);

}

after that you can use
lcd.write(1);
lcd.write(2);
lcd.write(3);
lcd.write(4);
lcd.write(5);
lcd.write(6);
to print them out to your display...

Hmm..

tried to make a String with some testtext..

String message=" Test åäö ÅÄÖ ";
message=message.replace("å", byte(1));
message=message.replace("ä", byte(2));
message=message.replace("ö", byte(3));
lcd.print(message);

gave me an error:
error: call of overloaded 'replace(const char [3], byte)' is ambiguous

Ideas over how to get this to work? I need to make a function that does this, as there are alot of texts(lists of names from SDcard) and they all need to be checked for swedish letters.

You're replacing a character, not a string, so change "x" to 'x'.

DOhh...
Thank you..

Hello. im writing a code that needs to be in swedish, therefore i need to use "åäö".

You should use a LCD that has a ROM containing those characters ...

Actually the most common HD44780U ROM (A00) contains two of those characters already. You can display ä by using 0xe1 and you can display ö by using 0xef.

Don

I have made my own library that parses in this caracters now, not the "best" way to do it, but the most fun anyway:)

Buying a cheap Chinese display is better in the end for me, and i got it to work in the end.. :slight_smile: