-
Notifications
You must be signed in to change notification settings - Fork 46
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
Oled low brightness. #16
Comments
Hi There is no mpd_oled option to control the brightness. From a quick search, I am unsure if it is possible to implement this properly in software. There appears to be a command for SSD1306 to control contrast, but it seems that it only has a limitted effect on brightness, and the full brightnes range involves a variable resistor (maybe a variable resistor on its own is enough). There are some interesting threads here Adrian. |
I've managed to see dimming oled using https://flows.nodered.org/node/node-red-contrib-oled (with the "Dimmed" block). Down under it is a javascript library : https://github.com/baltazorr/oled-i2c-bus/blob/master/oled.js#L340 |
Hi Arthur The javascript code refers to "contrast", so I imagine this works the same way as the dimming function included in the mpd_oled OLED driver code, in which case setting the contrast to 0 in mpd_oled might work to dim an SSD1306 screen. I have ordered an SSD1306 screen so I should be able to test this soon. Adrian. |
I've noticed during testing that setting some of the OLED types gives differing brightness values. I think there's a command and some data that gets sent to the screen during initialisation that could be used to support this. i'll do some digging. |
Hi Mase Thanks for looking at this. I am in the processes of changing mpd_oled to use the U8g2 library, and this provides a setContrast function https://github.com/olikraus/u8g2/wiki/u8g2reference#setcontrast I imagine it will do all that can be done in software to change the brightness. I will add an option for it. Adrian. |
U8g2 is great, the only trouble is that it takes a while to compile. Have you considered compiling on a non Pi and dropping the binary over? Anyway, I found it. It's in I might implement this in my older branch, if I get time. |
Bah, I tested this but it made no difference to the brightness :( |
1 similar comment
Bah, I tested this but it made no difference to the brightness :( |
Hi Mase The total build time for U8g2 library is less than 10 minutes on a Pi Zero, which isn't too bad, but it doesn't really affect development time as once it has been built mpd_oled just links to it. I have sometimes cross-compiled on the Pi 4 and copied the binary over to the Pi Zero to test, but usually for bigger changes I write the code on the Pi 4, but only to ensure a successful build, and then copy over the code to the Pi Zero and change it there to make it work. The brightness function may work for the SSD1306, but I don't think you can change the brightness of the SSH1106 using software. Adrian. |
OK brightness has no effect but precharge setting like you suggested in your links does work :) |
Where there is a |
@arthurlutz I have implemented contrast and pre charge period control in my fork of I did this as an experiment for testing purposes but works pre charge is |
Is it possible to adjust the brightness of the screen?
The text was updated successfully, but these errors were encountered: