Where we dont clear display in each loop, but after some time, like 100ms
So generaly in first example pixels go off and on in each iteration.
In second example pixels are updated in each iteration and pixels go off and on each 100ms.
QUESTION: does OLEDs MTBF is increased when pixels are off-on frequently or its better to turn off-on less frequently.
for LEDs it allow to decrease power consumption and increase MTBF, but is it also applyable for OLEDs???
only the last one actually changes the display. This is because the library is only clearing a and printing to a buffer (virtual screen image or canvas) inside the Arduino's memory. That memory buffer is transferred on the last line so you can have as many graphical commands as you like before this and they do not turn on/off the OLED pixels.
Knowing that changes the assumptions.
OLEDs do have a life, typically 3-5 years has been estimated, at which point they have not failed but the brightness has reduced to 50%.
The life of a pixel is mainly going to be temperature dependent with a small increased degradation in pixels that are switched on. So to maximise life keep your display cool and do not use it.
The life of a single isolated OLED display is difficult to predict as you may have one with a manufacture defect.... so it is not really worth worrying about trying to increase the life.
MTBF is a statistical calculation and is really only useful when 100's of thousands of parts are being considered during the phase of life between infant mortalities and wear-out. It is also meaningless unless the conditions are known and what constitutes a failure is specified, for example the MTBF of a 25 year old human is about 800 years, this is because if you take 800 humans each being 25years old and monitor them for 1 year in good conditions, then statistically only 1 will die (e.g. has a failure). Clearly this does not mean an individual human will live 800 years...
In an OLED, each pixel is an LED so the current consumption is directly proportional to how many pixels are on, for the display you have the current consumption will be ~0mA with all pixels off and ~30mA with them all on.
Ok so theres no way or no reason to fast swtich off-on OLED display, so that human eye cant see the changes but time of display displaying is reduced by half?
Try putting these different commands in your sketch if you want to save power:
display.ssd1306_command(SSD1306_SETCONTRAST);
display.ssd1306_command(c); // Where c is a value from 0 to 255 (sets contrast e.g. brightness)
display.ssd1306_command(SSD1306_DISPLAYOFF); // To switch display off
display.ssd1306_command(SSD1306_DISPLAYON); // To switch display back on
These are the best ways to reduce current consumption.
Not that visually the contrast change is quite small changing c from 0 to 255