Page 1 of 1

switch off baclight 7 inch touchscreen

Posted: Monday 01 January 2018 20:08
by Pauls
Hi,

I have a 7 inch touchscreen in combination with an RPI v3 as a domoticz controller.
All works ok, but i am looking for a solution to switch the screen backlight off by a button in dashticz.
Tapping the screen should switch to backlight on.
Is it possible to create such functionality ?

Greetings,

Paul.

Re: switch off baclight 7 inch touchscreen

Posted: Tuesday 09 January 2018 17:04
by Pauls
Well, lets reply on my own question....
I have made a software button which starts a bash script that switch the backlight on:
#!/bin/sh
echo 0 > /sys/class/backlight/rpi_backlight/bl_power

and off:
#!/bin/sh
echo 1 > /sys/class/backlight/rpi_backlight/bl_power

Because I have a master and slave RPI, the button status is send from the master back to the slave (the one with the 7"screen) in which the script is run.
It works ok, but when the screen is dark, it is a bit difficult to find the exact place for the button to switch the screen back on.
I wonder if there is a way to use the entire screen as a switch function to start the script?