Hi, I would like to print to the screen a string, reported below in Details, with the celsius degree symbol "°". However, I find other characters if I look to the screen. Is it possible to change alphabet with some option of the STM32CubeID to find "°"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-01-24 04:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-01-24 04:57 AM
Welcome, @Nicolò Meloncelli, to the community!
This has nothing to do directly with the STM32CubeIDE, but with the character set that your display supports. You would have to look at its datasheet and find out if it has the DEGC character in its character set. If it does, you would have to send its hex code as a character, but that would only apply to that particular display.
Does it answer your question?
Regards
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-01-24 07:00 AM
Hi Peter,
with the following code variation I've the symbol "°" in the display. I don't know why I can't write == '°' and leave "°C" instead of =='?' and " ?C". If I do so the if condition is skipped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-01-24 10:46 AM
Well, you have not yet inserted the character set of your two-line LCD here. As a rule, the character set only partially matches that in operating systems such as Windows, Linux or MacOS, mostly only in the ASCII range 0x20 (space)...0x7D (left curly bracket).
However, on many of these LCDs, the question mark is usually coded with 0x3F and the degree sign with 0xDF.
You should now check:
- how the character set of the LCD is defined,
- which byte your compiler generates at the position of the question mark and,
- if necessary, replace the question mark, which is not recognisable as a degree sign in the source code, with the corresponding hexadecimal code.
I would also check how the display routine converts the bytes to be sent to the LCD from the input string.
By the way: please be so kind and do not post source code snippets as screenshots, but for better readability and testability with the code snippet button </> below the text box.
Regards
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-01-24 11:01 AM
