Arabic text support in LCDs [LiquidCrystalArabic.h]

thanks for the clear info

thanks again Sir
for quick reply & good job
i've checked the file with atmel start & i want to ask you about moveCursorToLeft
how can i use it ?
an example will be great

‫في الخميس، 5 يونيو 2025 في 2:07 م تمت كتابة ما يلي بواسطة ‪Balawi28 via Arduino Forum‬‏ <‪notifications@arduino.discoursemail.com‬‏>:‬

You are welcome.

You can simply just call lcd.moveCursorToLeft(), this method is designed to move the cursor one cell to the left and wrap to the next line if the end of line is reached, it is internally used by printArabic function, to move the cursor after printing each character, you can think of it as printing one space (empty cell). example:

// BAD EXAMPLE, DO NOT USE IT
#include "LiquidCrystalArabic_I2C.h"

LiquidCrystalArabic lcd(0x27, 16, 2);

void setup() {
    lcd.init();           
    lcd.backlight();
    lcd.printArabic("مرحبا");
    lcd.moveCursorToLeft();
    lcd.printArabic("بكم");
}

void loop() {}

But you should never use it, as it will mess up the text, that's because of how my library is designed.

Instead just print the full Arabic text directly:

#include "LiquidCrystalArabic_I2C.h"

LiquidCrystalArabic lcd(0x27, 16, 2);

void setup() {
    lcd.init();           
    lcd.backlight();
    lcd.printArabic("مرحبا بكم");
}

void loop() {}
1 Like

thanls Sir
it works great

i apreciate your good job

1 Like