Is there a way to adjust the brightness of the official touchscreen display? I couldn't find a definite answer. I'm running the latest release of Raspbian Jessie.
The driver for the screen provides an interface through
/sys/. To turn the screen on you can use the command:
echo 0 > /sys/class/backlight/rpi_backlight/bl_power
and to turn it off:
echo 1 > /sys/class/backlight/rpi_backlight/bl_power
the brightness can be adjusted using:
echo n > /sys/class/backlight/rpi_backlight/brightness
n is some value between 0 and 255.
I've made a Python package for this: github.com/linusg/rpi-backlight. Now you don't need to implement this yourself anymore.
(GIF is outdated and API changed just a little, sorry... Below example is correct 🙂)
Works basicly like the above, example:
>>> import rpi_backlight as bl >>> bl.set_brightness(255) >>> bl.set_brightness(20, smooth=True, duration=3) >>> bl.get_max_brightness() 255 >>> bl.get_actual_brightness() 20 >>> bl.get_power() True >>> bl.set_power(False)
It has a GUI, a CLI and a simple API :)
protected by Community♦ Aug 24 '16 at 20:55
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?