greiman / SSD1306Ascii

Text only Arduino Library for SSD1306 OLED displays
MIT License
499 stars 122 forks source link

Brightness issue #12

Open nervusvagus opened 8 years ago

nervusvagus commented 8 years ago

Hi, I did a few tests before writing this and I'm almost convinced that this issue relates only to this library.

I have a chinese made 128x64 Oled display that I run with software SPI. In addition I have plenty of I2C sensors on board.

When I run these together 7 out of 10 times I have an issue with the brightness of the OLED screen.

I tried running other libraries and their brightness seems to be ok. I set the contrast value in setup to oled.setContrast(255); however that still doesnt effect anything.

I also had issues with the display not showing but when I connected the Ground of display to a seperate GND of Arduino that issues seems to be gone.

Is this something related to the library that someone can help with?

greiman commented 8 years ago

The display is initialized close to the settings in this library Adafruit_SSD1306.

I initially modified the Adafruit library but later totally rewrote this text only library keeping the Adafruit style device settings.

You might copy the setting sequence used by other libraries. You can add your custom sequence to SSD1306init.h.

eos1d3 commented 8 years ago

Hi,

setContrast works 100%. I just tried with value of 0, 127 and 255 and can confirm all work!

I used this oled.begin(&Adafruit128x64) to init the driver without any modification. And I have verified the data in the Adafruit128x64init with controller manual. All commands and data are correct.

I am also using the 0.96" China made module with SPI. I run it for a few days, it never has problem.Please check if it is i2C startup issue. (or add a little delay?)

SSD1306_SETPRECHARGE value also changes the brightness. Bit 7:4 is charge period and bit 3:0 is discharge period. Using 0xF1 will be the highest charge period and have highest brightness.

WARNING: OLED life is VERY VERY short because of its lumen depreciation. For me, I believe never use the default value. It is too bright that it will be washed out in just 1 or 2 days of use!!!!!

To test this, display a text pattern with white on black for one day. Then invert the display color to black on white background without displaying any text. You will see the text you displayed earlier is on the screen and is burned there.

By using the smaller value to contrast value, it helps a lot for this problem but the wash-out problem is never be eliminated even with value of 0. That I why I will never buy any oled TV.

Use this oled module with very little screen turn-on time!!

boyswat commented 6 years ago

Hi,

i setContrast to 0 or random number < 100 oled will not work, i try 127 and 255 it work but not different.

i try edit in SSD1306init.h that still doesnt effect anything. SSD1306_SETCONTRAST, 0xff, at Adafruit128x64init

greiman commented 6 years ago

Does it work with the Adafruit library?

I can't really help you since I don't have your display. It works with my Adafruit 128x64.

boyswat commented 6 years ago

Hi, i try Adafruit but it not display anything. and i try OakLED work but it still no difference i set 255 and 1. i use oled 0.96 ssd1306 i2c white.

EDIT: I try again and it work, thanks :D

HDBro commented 6 years ago

My OLED screen works perfectly fine. But for the project I am working on, the screen has to be brighter then normal. Any help on that?

greiman commented 6 years ago

It's not possible to increase the brightness much. I have it near max.

This may help a little.

  oled.ssd1306WriteCmd(SSD1306_SETVCOMDETECT);
  oled.ssd1306WriteCmd(0X70);
  oled.setContrast(255);
VICLER commented 3 years ago

Hi! I'm testing my firmware on SSD1306 and SH1106 and today I noticed, that If I initialize an SH1106 display with Adafruit128x64 the display is darker. But it looks very nice! There appears something like shadow, and text looks 3D. So my question is what should I do to get this effect by initializing the display as SH1106? Here is SH1106 initialized as SH1106: IMG_20201016_184845 IMG_20201016_184928

And here SH1106 display initialized as Adafruit128x64: IMG_20201016_185057 IMG_20201016_185225

*edit got it! in SSD1306init.h

static const DevType MEM_TYPE SH1106_128x64 = {
    // SH1106_128x64init,
    // sizeof(SH1106_128x64init),
    Adafruit128x64init,
    sizeof(Adafruit128x64init),
    128,
    64,
    2 // SH1106 is a 132x64 controller.  Use middle 128 columns.
};