U8g2: Graphics Library for Monochrome OLEDs and LCDs

Hi Bob

Configuration is done via the constructor call. Some sample constructors are there in each example file. So if you find a matching constructor, just uncomment the constructor. For I2C you may need to set the I2C address in the setup() function.

If your display is connected to the hardware I2C pins of your controller, then you can uncomment the following line

//U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);

Oliver

How to define font to use my national characters like ąłśćńżźĄŁĘ itp? I'm from Poland and I use polish language, I try to find somethings in u8g2_fonts.c but I can't find nothing helpfully.

PS. I use constructor defined as U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=/ SCL, / data=/ SDA, / reset=*/ U8X8_PIN_NONE); // All Boards without Reset of the Display

/EDIT/
Also I have problem with other fonts, chinese from example show me question mark instead of chinese chars also when I try u8g2_font_cu12_t_cyrillic and want to show честь then in Arduino IDE it is looks ok but on my oled I got only question mark instead of chars from cyrillic. I use oryginal HelloWorld example with 128x64 oled display U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=/ SCL, / data=/ SDA, / reset=*/ U8X8_PIN_NONE); // All Boards without Reset of the Display in example file I only uncomment line with constructor and change setFont and drawStr.
I need some specified settings for Arduino IDE?

Hi

Does the PrintUTF8 example work? Do you see the japanese glyphs on in the IDE and on the display?
If yes, everything should be fine.

Regarding the glyphs: The problem is, that the font must include the required glyphs for your language. So best is to crosscheck fntgrpunifont · olikraus/u8g2 Wiki · GitHub for a font, which includes glyphs for your local language.
If there is no font with your glyphs, please raise a ticket in the u8g2 issue tracker: Issues · olikraus/u8g2 · GitHub

Oliver

PrintUTF8 example doesn't work.
This is what I get on my oled display:

and this is what I see in Arduino IDE:

I use Arduino IDE 1.6.13
and constructor: U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=/ SCL, / data=/ SDA, / reset=*/ U8X8_PIN_NONE); // All Boards without Reset of the Display

Strange. I heard about this problem before, but i do not know a solution. Assumption is, that the c-compiler assumes something different than UTF8 encoding.

On linux you may try to start the IDE in the default language setup:

LANG= && ./arduino &

You could also try the latest Arduino IDE

Some discussion as happend here also:

I personally think that the commandline option "-finput-charset=UTF-8" is missing.

Oliver

olikraus:
don't you also require a special constructor?
Maybe you can add the constructor line for the u8g2 object also.

Yes, but I would not call it very "special"! Here it is:

U8G2_KS0108_128X64_F u8g2(U8G2_R0, U8X8_PIN_NONE, U8X8_PIN_NONE, U8X8_PIN_NONE, U8X8_PIN_NONE,
                          U8X8_PIN_NONE, U8X8_PIN_NONE, U8X8_PIN_NONE, U8X8_PIN_NONE,
                          /*enable=*/ U8X8_PIN_NONE, /*dc=*/ U8X8_PIN_NONE, /*cs0=*/ U8X8_PIN_NONE,
                          /*cs1=*/ U8X8_PIN_NONE, /*cs2=*/ U8X8_PIN_NONE, /* reset=*/  U8X8_PIN_NONE);   // Set R/W to low!

The DC, CS0, CS1 pins on the display are driven by the pcf8574 chip. The KS0108 does not have a CS2 pin. RESET on the display is connected to the Wemos RST pin so they reset together. I suppose I could/should have written my code to give the Enable pin in the above constructor, but in the end I hard coded it in the U8x8lib.cpp file.

PaulRB, ah, yes, all is handled in the call back functions...
But still, I think this clarifys the usage of your approach.
Thanks,
Oliver

olikraus:
Well, sure, port to u8g2 should be there... I hope to get this done once. Thanks for the request.

Oliver

Oliver,
Are you still porting m2tklib to u8g2? If not is there another solution?

Thank you.

Guys again thank you for all the hard work that went into this. I am running behind, had some medical issues. but today i got my backpack done! Loading the u8g2 lib tomorrow. well later today its 4am and im cross eyed from all the soldering.

My wiring is NOWHERE near the neatness of Paul's. lol

As you can see I have the i2c scanner sketch running and the chips are responding. so at least i know some of the wiring is right :slight_smile:

will post once i get display up and running

You are using a Mega? I don't get that. I'm using a Wemos, which has very few pins but does have WiFi. Mega has more than enough pins to run the ks0108 without using extra chips. What's your motivation?

The mega was for testing. I will be using a esp8266 12F to run the display. the mega was just handy lol.

Ah, ok

jptheripper:
Oliver,
Are you still porting m2tklib to u8g2? If not is there another solution?

Thank you.

I have started some weeks back, but my spare time is very much limited :frowning:

It is in my mind, but i can not promise anything.

Oliver

hi I'm nor form Syria I need some information for my display it winstar
wg320240c0 with raio ra8835ap3n
haw contact to arduino mega
I don't find these display in ur library
please help me
I'm don't find any information online

Oliver

thanks olivar bat I have a problem any thing Is dabbling in thes haw I can changing form 240X128 to 320X240

:slight_smile:

ok, so you are saying it works a little bit, but instead of the support for 240x128, you need support for 320x240, correct?

I have created an issue for this:

Oliver

yes please I need
My graduation project stands on this

Hello.

I am hoping you can help me with a problem I am having.

I have a 128xc64 ST970 lcd.

If I use the U8G library it is fine, if I try the U8G2 library with exactly the same setup I get lots of ghosting and artifacting.

Would you have any idea on what could cause this ?

I have attached an image of the code and the respective output on the screen.

Large image link (Imgur)