Post a link to the LCD display, or check the data sheet to see what characters it is designed to display.
When defining C-strings, the "" is an escape character, with says to take the next character or special sequence as the character to print (so you can print the double quote character, for example).
It is very strange that you did not find anything, since the facts are well known...
Backslash \ has special meaning in most program languages, it usually indicates the start of i.e "escape sequences"
Yes after it was pointed out that the character does not exist it looks like adding a custom character is the only way. Sorry but I don't get what you mean by "handle printing separately"?
Well, even if you define the character it won't be in the right place in the lookup table in the LCD's ROM, so if the backlash is in a string that you want to print, you'll still print the yen symbol.
In my LCD library the backslash is replaced by the | as this is available on the most common character ROM set.
with this code:
#include <Wire.h> // needed for the I2C interface
#include <NoiascaLiquidCrystal.h> // download library from https://werner.rothschopf.net/202009_arduino_liquid_crystal_intro.htm
#include <NoiascaHW/lcd_PCF8574.h> // include the proper IO interface
const byte cols = 16; // columns/characters per row
const byte rows = 2; // how many rows
const byte addr = 0x3F; // set the LCD address to 0x3F or 0x27
LiquidCrystal_PCF8574 lcd(Wire, addr, cols, rows); // create lcd object - with support of special characters
void setup()
{
Wire.begin(); // start I2C library
lcd.begin(); // initialize the LCD
lcd.backlight(); // turn on backlight
lcd.setCursor(1, 0);
lcd.print("Hello backs \\");
lcd.setCursor(0, 1);
lcd.print("αβμΣ°÷∞←→äöüßÄÖÜ"); // show some special character entered in UTF-8
}
void loop() {
}
The library (for private usage) can be downloaded here:
You can embed a special character in a c-string my using a backslash followed by the octal representation of the special character number. If using character 0, use \010 as most LCD displays take 8-15 as well as 0-7 for the same set of special characters.
I agree but this is going into a much larger sketch and I like having the option to easily edit the characters (I wrote a little program in vb that generates the code based on which blocks I highlight so I can just copy paste into a sketch ) and for me easier to read since the portion in void setup will be in a function.