Hi all! I'm using a 128x32 OLED display on my in car dash project and am running it with the Adafruit 1306 library. It all works well but it is a little bright for night driving so I was wondering whether it is possible to dim the display programatically to avoid dazzling the viewer in the dark?
Hi David, thanks very much for that - the .dim function seems to work pretty well. How much contrast is this actually changing? I tried the other function but it didn't seem to do anything - I assumed the contrast figure was 0-255 and tried dropping it to 100 but no change...
In any case I think the .dim function might work ok but just curious as the contrast function may be allow some adjustability...
For an OLED display, there will be no difference between "contrast" and "brightness" - there is no "black level" to set as there is with LCDs and CRT displays.
As long as you set individual pixels as a proportion of your nominal white level - clearly a required function of the library - contrast and colour will be fixed.
david_prentice:
Just read the library source code. Search for dim(
Ah ha! Well spotted! I see this switches from 0 to contrast, and contrast is set to 0X8F which translates to 143 in decimal. Does this mean the function drops the brightness from 255 to 143? So perhaps I could adjust this value somehow to give brightness control?
Oh right! So 0x00 is the min then...! I was going to see if it could go dimmer as an experiment - it's probably ok at that level. If it only works at 143 then I guess it would give you sunburn at 255!!