# RPI Official touch screen

**URL:** <https://discourse.nodered.org/t/rpi-official-touch-screen/24704>\
**Category:** General\
**Created:** [12 April 2020 15:36 UTC](https://discourse.nodered.org/t/rpi-official-touch-screen/24704 "2020-04-12T15:36:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xsilvergs](https://avatars.discourse-cdn.com/v4/letter/x/7feea3/32.png) [@xsilvergs](https://discourse.nodered.org/u/xsilvergs)\
**Post date:** [12 April 2020 15:36 UTC](https://discourse.nodered.org/t/rpi-official-touch-screen/24704/1 "2020-04-12T15:36:22Z")

</div>

I am using the Official RPi Touch Screen V1.1 and wish to be able to turn the backlight off with a button.

The command to turn the backlight OFF is:  
echo 1 \> /sys/class/backlight/rpi\_backlight/bl\_power

The command to turn the backlight ON is:  
echo 0 \> /sys/class/backlight/rpi\_backlight/bl\_power

Running this in an exec node gives:

 ![Screenshot from 2020-04-12 16-33-00](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/8/08dde4deda9fbcb0faa791cc59decfe029344405.png)

Can some one advice if it's possible and how I run this as sudo cannot be used.

Thank you

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 April 2020 16:08 UTC](https://discourse.nodered.org/t/rpi-official-touch-screen/24704/2 "2020-04-12T16:08:23Z")

</div>

You can use visudo to tell the system that the node-red user is allowed to use sudo with that command without having to enter a password. Then it will run ok in an exec node. I don't remember the exact syntax you need in the visudo file but no doubt your favourite search engine will find it.  
First check the command in a terminal with sudo, does it ask for a password? If not then it will run in an exec node.

---

<div class="post-metadata">

**Author:** ![xsilvergs](https://avatars.discourse-cdn.com/v4/letter/x/7feea3/32.png) [@xsilvergs](https://discourse.nodered.org/u/xsilvergs)\
**Post date:** [12 April 2020 16:18 UTC](https://discourse.nodered.org/t/rpi-official-touch-screen/24704/3 "2020-04-12T16:18:22Z")

</div>

Colin,

Thank you for replying. I did delete this message as I created a bash file in /home/pi/display/rpi-lcd.sh , I will try your method.

This works in an exec node.  
sudo /home/pi/display/rpi-lcd.sh off

Tony
