Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split content with 2.42 OLED Display #197

Open
martix90 opened this issue Feb 16, 2021 · 11 comments
Open

Split content with 2.42 OLED Display #197

martix90 opened this issue Feb 16, 2021 · 11 comments

Comments

@martix90
Copy link

Hi,
I really like this very cool project and want to build my own WebRadio.

I would like to use a 2.42 OLED display that I have around. This uses an SSD1309 Chip, which (according to most Docu) is almost identical to the SSD1306. But when I configured this project to use the OLED display, the image is split in half and the left side is right and the right side is left (see image).
IMG_20210216_221219

If I use an example sketch with u8g2 the display works just fine.

Is there any idea what could cause this issue? Or is this type of display simply not supported? I think there's not much missing for it to work correctly...

@Edzelf
Copy link
Owner

Edzelf commented Feb 17, 2021

You need to modify the constructor and the init call on line 23 and 36 of "oled.h". It is now:
U8G2_SSD1306_128X64_NONAME_1_SW_I2C
And it should be the one for 1309. See https://github.com/olikraus/u8g2/wiki/u8g2setupcpp.
For example:
U8G2_SSD1309_128X64_NONAME2_1_SW_I2C

@martix90
Copy link
Author

Hi @Edzelf, first thank you very much for your answer. I just noticed I'm in the wrong project with my question (I'm using an ESP32) - but I think you already noticed - reading your answer :)

To be honest, I don't quite understand it yet. If "OLED" is defined, the file SSD1306.h is included. Here, oled.h is never used. If I instead include oled.h (where I have changed the two lines of your comment), it doesn't compile since oled.h does not have all the required functions (like for example displayvolume() ).
I think I did not understand something correct here :(

@Edzelf
Copy link
Owner

Edzelf commented Feb 17, 2021

You are right.
If you uncomment the #define OLEd in line 178 o main.cpp and comment the line with BLUETFT.
Then SSD1306.h is included.
The file oled.h is not in use anymore.
The driver for the SSD1306 is not quite compatible with the 1309.
I will try to fix that later.

@martix90
Copy link
Author

Thank you very much!

@Edzelf
Copy link
Owner

Edzelf commented Feb 19, 2021

Try the new version. I did not test it, because I don't have the right module.
3 models are available:

//#define OLED1306                     // 64x128 I2C OLED SSD1306
//#define OLED1309                     // 64x128 I2C OLED SSD1309
//#define OLED1106                     // 64x128 I2C OLED SH1106

@martix90
Copy link
Author

Wow - I'm really impressed with how fast you did the refactoring of the oled drivers. I will try it as soon as possible :) Thank you so much!

@martix90
Copy link
Author

martix90 commented Feb 20, 2021

Hi @Edzelf, I've just tested it. It's a lot better but not yet quite right. The lines seem to start at different columns Maybe an off-by-one error?

IMG_20210220_105243

@Edzelf
Copy link
Owner

Edzelf commented Feb 20, 2021 via email

@martix90
Copy link
Author

martix90 commented Feb 20, 2021

Hi @Edzelf , I now tried all three models (OLED1306, OLED1309 and OLED1106).
All of them behave exactly the same.

The model I use is called "DIY MORE" and says on the back "2,42' OLED, SSD1309", here's a links:
https://www.diymore.cc/products/2-42-inch-12864-oled-display-module-iic-i2c-spi-serial-for-arduino-c51-stm32-green-white-blue-yellow

One thing that I saw is that isSH1106 is initialized with true but there's also the line:

#if defined ( OLED1106 )                                      // Is it an SH1106?
    isSH1106 = true ;                                           // Get display type                         
#endif

So there's not really the chance for it to be false.
If I manually set it to false, it's again in the state it was in my first post (split screen).

Thank you and greetings from Germany
Martin

@martix90
Copy link
Author

I think I found the issue:
If I comment out this line, it works :)

//i2c_master_write ( i2Cchan, fillbuf, 4, true ) ; // Yes, fill extra RAM with zeroes

@Edzelf
Copy link
Owner

Edzelf commented Feb 24, 2021

Great!
The problem was that the variable isSH1106 was not set to false for non-SH1106 models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants