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

2.42-inch Waveshare OLED SSD1309 and contrast problem #2408

Open
JG24 opened this issue Mar 24, 2024 · 4 comments
Open

2.42-inch Waveshare OLED SSD1309 and contrast problem #2408

JG24 opened this issue Mar 24, 2024 · 4 comments

Comments

@JG24
Copy link

JG24 commented Mar 24, 2024

Hi there! Thanks a lot for your work. I managed to get the 2.42-inch Waveshare OLED display up and running. Everything would be fine if it weren't for the lack of ability to adjust the contrast of this display. According to the manufacturer, the display supports contrast control. Unfortunately, I can't seem to achieve it. Has anyone had a similar issue?

Additionally, I'll mention that I have the display connected via SPI to an ESP32.

Here's datasheet: https://files.waveshare.com/wiki/2.42inch-OLED-Module/SSD1309Datasheet.pdf

@olikraus
Copy link
Owner

which exact constructor did you use?

@JG24
Copy link
Author

JG24 commented Apr 1, 2024

which exact constructor did you use?

U8G2_SSD1309_128X64_NONAME0_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=/13, / dc=/16, / reset=*/17);

It works very well, except for the ability to change the contrast.

@olikraus
Copy link
Owner

olikraus commented Apr 1, 2024

I checked the code, but the setContrast() command should work.
You can also use

u8g2.sendF("ca", 0x81, contrast); // 'contrast' is the desired contrast value

to manually set the contrast (see also https://github.com/olikraus/u8g2/wiki/u8g2reference#sendf)

Sometimes the contrast command for the display (0x81) does not have the desired effect. In such cases could play around with the 0xd9 or 0xdb command of your display.

@olikraus
Copy link
Owner

olikraus commented Apr 1, 2024

See also here: #1504

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