Dim Adafruit screen on startup

Create a script with the following code in the pi home folder:

#!/bin/bash
gpio -g mode 18 pwm && gpio pwmc 1000 && gpio -g pwm 18 50 && sudo sh -c 'echo "0" > /sys/class/backlight/soc\:backlight/brightness'



Save it as: dim_screen

Make the file executable using this command:

chmod u+x dim_screen



Open /home/pi/.config/lxsession/LXDE-pi/autostart using nano and then add the following line:

@sh /home/pi/dim_screen

Links