no, I want to express, that this "right to left" is part of the functionality of the hd44780 compatible functions. It should work with the SPLC780D1 also. I just don't have a SPLC780D1 around currently, only a hd44780.
Can you please give it a try?
/*******************************************************************************
Support of Cyrillic characters on liquid crystal display
5036_Convert_Hebrew
This sketch includes several LCD hardware:
- Support LCDs with SPLC780D1 015A ROM (sold as "Hebrew" but also contains some Cyrillic) - https://s.click.aliexpress.com/e/_DBc5znh
You can switch through the examples by pressing enter in the serial monitor.
by noiasca
2022-12-26 right to left
2022-12-22 compiles but no specific LCD available to test
*******************************************************************************/
#include <NoiascaLiquidCrystal.h> // download library from https://werner.rothschopf.net/202009_arduino_liquid_crystal_intro.htm
const uint8_t cols = 16; // columns/characters per row
const uint8_t rows = 2; // how many rows
const uint8_t csPin = 10; // the CS pin for the MCP23S08 IC
const uint8_t addr = 0x3F; // set the I2C LCD address to 0x3F or 0x27
const uint8_t rs = 8; // parallel LCD
const uint8_t en = 9; // parallel LCD
const uint8_t d4 = 4; // parallel LCD
const uint8_t d5 = 5; // parallel LCD
const uint8_t d6 = 6; // parallel LCD
const uint8_t d7 = 7; // parallel LCD
const uint8_t bl = 10; // parallel LCD set to 255 if no backlight is used
//#include <NoiascaHW/lcd_4bit.h> // parallel interface, 4bit
//LiquidCrystal_4bit lcd(rs, en, d4, d5, d6, d7, bl, cols, rows, convert_SPLC780D1_015A); // create lcd object with special converter
#include <Wire.h>
#include <NoiascaHW/lcd_PCF8574.h> // I2C
LiquidCrystal_PCF8574 lcd(addr, cols, rows, convert_SPLC780D1_015A); // create lcd object I2C most common addresses are 0x3F or 0x27
//#include <NoiascaHW/lcd_spi.h> // SPI MCP23S08 Adapter
//LiquidCrystal_SPI lcd(0x40, csPin, cols, rows, convert_SPLC780D1_015A); // create lcd object - with special characters
// the structure of the content information
struct Content
{
const char lang[3]; // iso language code
const char *output1; // just a sentence to be displayed
const char *output2; // special characters used in that language (as far as I found them on wikipedia)
};
// Demo content to be printed on the LCD
Content content[] = {
{"he", "Hebrew 1", "טיךכלםמן"},
{"he", "Hebrew 2", "אבגדהוזח"},
{"he", "Hebrew 3", "נסעףפץצקרשת"},
//{"ru", "Добрый день", "А Б В Г Д"}, // Dobryy den' - hello
//{"ru", "доброе утро", "Е Ё Ж З И"}, // dobroye utro - good morning
//{"ru", "Добрый вечер", "Й К Л М Н"}, // Dobryy vecher - good evening
//{"ua", "доброго вечора", "О П Р С Т"}, // dobroho vechora - good evening
//{"bu", "добър вечер", "У Ф Х Ц Ч"}, // dobŭr vecher - good evening
//{"sb", "добро вече", "Ш Щ Ъ Ы Ь"}, // dobro veče - good evening
//{"mz", "добро попладне", "Э Ю Я"}, // dobro popladne - good evening
//{"de", "Latin", "ä ö ü ß "}, // some latin letters
//{"sm", "Symbols", "µ °C"},
};
// for Hebrew use this instead of a lcd.clear()
void myClear()
{
lcd.clear();
lcd.rightToLeft();
//lcd.autoscroll();
lcd.setCursor(cols - 1, 0); // set cursor to start position
}
void setup()
{
Serial.begin(115200);
Serial.println(F("+++++++++++++++"));
//SPI.begin(); // start SPI if needed
Wire.begin(); // start the I2C/Wire Library if needed
lcd.begin(); // initialize the lcd
lcd.backlight(); // turn on backlight
lcd.setCursor(0,0);
showBegin();
}
void loop()
{
doDemo();
}
void doDemo()
{
static byte i = 0;
if (Serial.available() > 0)
{
Serial.read();
Serial.println(content[i].lang);
lcd.clear(); //myClear();
lcd.print(content[i].lang);
lcd.print(": ");
lcd.print(content[i].output1);
lcd.rightToLeft();
lcd.setCursor(cols - 1, 1);
lcd.print(content[i].output2);
i++;
i = i % (sizeof(content) / sizeof(content[0]));
}
}
void showBegin()
{
Serial.println(F("convert Hebrew characters"));
lcd.setCursor(0, 0);
lcd.print("Hebrew/Cyrillic");
lcd.setCursor(0, 1);
}
// example print the second row right to left for Hebrew
void showLanguage(size_t i)
{
Serial.println(content[i].lang);
lcd.clear();
lcd.leftToRight();
lcd.print(content[i].lang);
lcd.print(": ");
lcd.print(content[i].output1);
delay(1000);
lcd.rightToLeft();
lcd.setCursor(cols - 1, 1);
lcd.print(content[i].output2);
}
I'm not working with platformio, hence I don't know what's needed for that.
Further more, is there any chance you could provide me a picture of the LCD showing one row in Hebrew with my sketch for my homepage?
edit: code updated (Latin left to right, Hebrew right to left)