Printing Special Characters OLED

Hi there,

I want to print on an oled display a couple of special Characters and I want to know how to go about doing that. The characters I want to make/Print are:
✓ and a character to indicate ON Similar to the one in the image below

Also, how would I be able to incorporate these Characters to an existing font library ?

Which library?

Some libraries allow users to define special characters. https://www.digikey.com/en/maker/blogs/2022/create-custom-characters-using-a-common-16x2-liquid-crystal-display

Others use fonts so the symbol must be a part of the font. How to display your symbols | Creating Custom Symbol Fonts for Adafruit GFX Library | Adafruit Learning System

For an OLED display, it might be good to see how you can define the special characters as pictures. So when you want to show it, you just use a command to visualize a bmp image, as this still depends on the libraries you use, but you didn't say which ones they are.

Oh ok, I am using the Adafruit featherwing libraty to make the display work and I have the Adafruit GFX library installed.

Oh perfect! I think the 2nd link is exactly what I needed thanks

Just an additional idea that might be worth a try.

I wanted to print a special yet familiar character, the 'μ' (Mu) symbol. I tried using ASCII code 0xB5 (DEC 181) in a Serial.write(181); statement, but this gave a non-printing character.
In the end, I simply copy & paste'd the symbol from an Arduin-forum website directly into the message string, as in Serial.println("time(μs)"); This had worked!!!

When printing the display-code using Serial.println('μ', DEC);,
the result was 52924 (0xCEBC). How could one have derived that code from Arduino documentation or its IDE?

The OP's ON-symbol is likely special-to-purpose, but the tick-symbol might already exist in the display system's font/code-table.

The above might seem "quirky", but some simple emperically-based solutions can save an awful lot of headache.

nb. The pronounciation of "μ" is a bit similiar to the first sylable of the German word "mühsam", an adjective meaning "laborious".

Thanks to all for a great Forum!
Peter

If it is in the available character set in both systems it is totally as valid as 1, 2, 3, a, b, c, etc

The serial monitor uses UTF-8 unicode encoding. You do need to be careful if using char arrays that you have sufficient space for the multi-byte characters.

A good point! It got me to look-up UTF-8 codes.

The Mu character is listed as a "double-byte" sized item (cf. https://www.utf8-chartable.de/).

I tried the same copy+paste trick (from webpage to code in IDE ) with the tick/check symbol and this worked too!! Whatever character-mapping the OP is using, this would be an easy way to test what is in that map.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.