LCD 16X2 type LCM1602A-FL-YGW-H

The a/m LCD support the Hebrew letters. Its work fine with English letters. I didnt find how to be able to use the Hebrew letters. On normal connection, writing Hebrew letters appear like gibrish.

Any help will be appreciated

You will be more likely to receive help if you post a link to the datasheet.

Don

Edit:

Re: LCD 16X2 type LCM1602A-FL-YGW-H

Are you sure about that part number?

Hebrew letters usually appear in the higher end of the ASCII table. After 0x7F (127). Make a sketch which will print all the characters starting from 128 and finishing with 255, you will notice that a specific range will have the Hebrew alphabet in it.

Floresta : you r right it should be : LCM1602A-FL-YBW-H
The coolest: you r absulotly right. Heb letters start at ascii 160 to ascii 186.
I wrote a small code like this :

#include <LiquidCrystal.h>


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);


void setup() {
  
  lcd.begin(16, 2);
 
 lcd.cursor();
 lcd.clear();
   lcd.rightToLeft(); 
   lcd.setCursor(10,0);
    lcd.write (169);lcd.write (165); lcd.write (167); lcd.write (169);
    lcd.setCursor(10,1);
      lcd.write (182);lcd.write (165); lcd.write (183); lcd.write (184);
       lcd.noCursor();
}

void loop() {


 
 
  // lcd.rightToLeft(); 
 //   lcd.setCursor(1,1);
  //  lcd.write (169);lcd.write (165); lcd.write (167); lcd.write (169);
  //  lcd.setCursor(1,0);
   //   lcd.write (182);lcd.write (165); lcd.write (183); lcd.write (184);
    
   
  
  }

The question is , there is any pins configaration that allow to print directly as a string in hebrew letters?

The question is , there is any pins configaration that allow to print directly as a string in hebrew letters?

I think you mean that you want to do something like this, except in Hebrew.

 lcd.print("hello, world!");

This would be accomplished by programming, not by any change in the pin configuration.

The compiler knows enough about the ASCII table to convert the English letters inside the quotes to the appropriate ASCII code but it doesn't know much about Hebrew or Japanese or any other language (like many Americans, myself included). You would have to come up with your own code to create the appropriate string.

You would probably also want to initially position the cursor at the right side of the display and then decrement the addressing to print right to left. This part is easily handled by the LCD controller with the appropriate commands.

Don

Thanx Don for your quick response.
As U can C from the attached code, the command lcd.rightToLeft partially solve the text direction.
Do U have any idea beside the one in my attached code to do the job ?
I beleive I can make a function that slice the Hebrew string to letters and send the appropriate char to the screen.
Could you advice how I cam make this function a LIBRERAY so I can include it in my sketches ?

floresta: This would be accomplished by programming, not by any change in the pin configuration.

Indeed. No point mucking about with the pins.

floresta: The compiler knows enough about the ASCII table to convert the English letters inside the quotes to the appropriate ASCII code

Actually, it doesn't. Compiling text strings works because the correspondence between the characters and the character values are mapped in the same way in the PC and the LCD.

If you know the font for the Hebrew (which is in the datasheet), you should be able (on a Windoze machine) to type the values into a text string as Alt-numeric codes just as I could type the "?" character as right-Alt 225 on the numeric pad. It will then compile to a string which will print on the LCD.


Could if I were running Windoze. 8)

@YohiZucker

My suggestion is to modify the LCD library you are using. I'm assuming that you are using the LiquidCrystal Library that comes with the Arduino IDE. Here's what I suggest you do, modify the ...\libraries\LiquidCrystal\LiquidCrystal.cpp file with the following code:

inline size_t LiquidCrystal::write(uint8_t value) {
    // In your sketch add #define HEBREW_TEXT when you want to enable printing in hebrew.
#ifdef HEBREW_TEXT
    if (value >= 224) // Find out what the char code for ? if this code doesn't work.
        value -= 64; // 224 - 64 to start at 160. Change this value if needed.
#endif
  send(value, HIGH);
  return 1; // assume sucess
}

I have not tested it, but you can tweak it to fit your needs. As I pointed out in the code, add '#define HEBREW_TEXT' when you want to enable printing in Hebrew.

EDIT: Note that the above will only work if the sketch file is saved as plain text, ASCII, and not a unicode file.

Actually, it doesn't. Compiling text strings works because the correspondence between the characters and the character values are mapped in the same way in the PC and the LCD.

I don't think the PC has anything to do with it. Compiling text strings works because the correspondence between the characters and the character values are defined by the ASCII code and the compiler knows this correspondence. The A in ASCII stands for 'American' which is why the code (or the compiler) does not know how to deal with Hebrew or Japanese or any other language.

Don