0

I have a 2.4 inch adafruit monitor for my rasberry pi, connected through the GPIO pins, and I have a problem with setting the screen brightness.

https://learn.adafruit.com/adafruit-2-4-pitft-hat-with-resistive-touchscreen-mini-kit/backlight-control

On the product page it says that the backlight can be controlled with the 18th GPIO pin, but I have no luck.

I am using the custom raspbian image that this monitor requires, downloaded from the adafruit website. Everything works fine except this.

So as the tutorial says, I have tried controlling it through the 18th pin, I have entered the following in the console:

sudo sh -c 'echo "1" > /sys/class/backlight/soc\:backlight/brightness'
gpio -g mode 18 pwm
gpio pwmc 1000
gpio -g pwm 18 100

I think this code should lower the brighness to 100 out of 1023, which would be 9.7% brightness, but nothing happens.

No error is given, it's as if the command is doing nothing.

Please help!

0

Some of the tft monitors require you to solder together a jumper labeled after gpio 18.

the jumper is typically two silver pads next to each other. put a solder blob on that connects both.

  • Doesn't that do the opposite? On the adafruit website it says that soldering it together actually disables the pin or did I read that incorrectly? – PiNewbie Sep 19 '17 at 17:17
0

I found the solution on Adafruit's forums.

https://forums.adafruit.com/viewtopic.php?f=50&t=127201&p=635357&hilit=gpio+18+pwm#p635357

They put it backwards on their website. Turn backlight off with

sudo sh -c 'echo "0" > /sys/class/backlight/soc\:backlight/brightness'

Then you can control with gpio 18.

gpio -g mode 18 pwm
gpio pwmc 1000
gpio -g pwm 18 100

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.