
Hi all,
I have modified the Github Python Project "rpi-backlight" to work with the Asus Tinkerboard
A Python module for controlling power and brightness of the official Raspberry Pi 7" touch display.
![[Image: example.gif]](https://raw.githubusercontent.com/linusg/rpi-backlight/master/docs/_static/example.gif)
Features
Change the display brightness smoothly or abrupt
Set the display power on or off
Toggle the display power on and off
Get the current brightness
Get the maximum brightness
Get the display power state (on/off)
Command line interface
Graphical user interface
Requirements
A TinkerBoard including a correctly assembled 7" touch display v1.1 or higher (look on the display's circuit board to see its version) running a Linux-based OS
Python 3.5+
Optional: TinkerBoard: gir1.2-gtk-3.0 for the GUI install
Installation
Clone this repository and install by:
Usage
API
Example in a Python shell:
NOTE: Code using set_ functions of this library has to be run as root, e.g. sudo python file.py , if the permissions for changing the backlight were not changed as described in the installation section!
CLI
Open a terminal and run rpi-backlight as root:
GUI
Open a terminal and run rpi-backlight-gui as root.
![[Image: gui.png]](https://raw.githubusercontent.com/linusg/rpi-backlight/master/docs/_static/gui.png)
Adding a shortcut to the LXDE panel
![[Image: panel_result.png]](https://raw.githubusercontent.com/linusg/rpi-backlight/master/docs/_static/panel_result.png)
See docs.
Find it at:
http://github.com/p1r473/rpi-backlight
I have modified the Github Python Project "rpi-backlight" to work with the Asus Tinkerboard
A Python module for controlling power and brightness of the official Raspberry Pi 7" touch display.
![[Image: example.gif]](https://raw.githubusercontent.com/linusg/rpi-backlight/master/docs/_static/example.gif)
Features
Change the display brightness smoothly or abrupt
Set the display power on or off
Toggle the display power on and off
Get the current brightness
Get the maximum brightness
Get the display power state (on/off)
Command line interface
Graphical user interface
Requirements
A TinkerBoard including a correctly assembled 7" touch display v1.1 or higher (look on the display's circuit board to see its version) running a Linux-based OS
Python 3.5+
Optional: TinkerBoard: gir1.2-gtk-3.0 for the GUI install
Installation
Clone this repository and install by:
Code:
$ sudo apt-get install gir1.2-gtk-3.0
$ git clone http://github.com/p1r473/rpi-backlight.git
$ cd rpi-backlight
$ sudo python3 setup.py install
Usage
API
Example in a Python shell:
Code:
>>> from rpi_backlight import Backlight
>>>
>>> backlight = Backlight()
>>> backlight.brightness
100
>>> backlight.brightness = 50
>>> backlight.brightness
50
>>>
>>> with backlight.fade(duration=1):
... backlight.brightness = 0
...
>>> backlight.fade_duration = 0.5
>>> # subsequent `backlight.brightness = x` will fade 500ms
>>>
>>> backlight.power
True
>>> backlight.power = False
>>> backlight.power
False
>>>
NOTE: Code using set_ functions of this library has to be run as root, e.g. sudo python file.py , if the permissions for changing the backlight were not changed as described in the installation section!
CLI
Open a terminal and run rpi-backlight as root:
Code:
$ rpi-backlight -b 100
$ rpi-backlight --set-brightness 20 --duration 1.5
$ rpi-backlight --get-brightness
20
$ rpi-backlight --get-power
on
$ rpi-backlight -p off
$ rpi-backlight --get-power
off
$ rpi-backlight --set-power off :emulator:
$
GUI
Open a terminal and run rpi-backlight-gui as root.
![[Image: gui.png]](https://raw.githubusercontent.com/linusg/rpi-backlight/master/docs/_static/gui.png)
Adding a shortcut to the LXDE panel
![[Image: panel_result.png]](https://raw.githubusercontent.com/linusg/rpi-backlight/master/docs/_static/panel_result.png)
See docs.
Find it at:
http://github.com/p1r473/rpi-backlight