Arduino Asked by LittleWhole on September 25, 2021
I’m making a project that requires me to display Chinese and Japanese characters on an LCD. However, the 16×2 LCD display I have does not seem to support displaying Chinese and Japanese characters.
If I do something like lcd.print("おはよう世界");
or lcd.print("简体中文测试");
, it seems to display just a bunch of jumbled random characters (which I am assuming have their character values add up to the values of the characters in the code).
How can I get my LCD to display Chinese and Japanese characters?
Or, if there’s no way to do it without buying a new one that supports it, where can I buy one?
Displaying Kanji or Chinese characters is way beyond the ability of an LCD that displays 5 pixel by 7 pixel characters.
To understand the limitations, take a piece of graph paper and draw out a set of 5x7 rectangles. See if you can define ANY recognizable Japanese or Chinese characters on your graph paper.
Maybe a couple of characters? (Then again, maybe not.)
You need a display with a lot more resolution, like an OLED graphics display. You are also struggling against a microcontroller that doesn't have support for Unicode. It's just not up to the job. You'd be much better off with a Raspberry Pi and a screen like a smart-phone color LCD screen. Install Linux and you can have native support for Unicode.
As others have pointed out, hiragana or katakana would be more practical, and there are some low-res LCDs that support those characters.
Correct answer by Duncan C on September 25, 2021
Your LCD uses a single byte for the character to display, so there are < 256 characters possible. 8 of them are userdefineable, the others are predefined in the LCD-ROM.
The Arduino IDE uses utf-8 code, which takes more than a single byte for all non-ascii characters like in your "おはよう世界".
Even if the character set contains the ones you want to display, you need an escape sequence to have them properly in your print statement.
Answered by DataFiddler on September 25, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP