Settings screen brightness with RPI.GPIO

Home Forums Forums Technical Support for PiScreen Settings screen brightness with RPI.GPIO

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #4238
    Patrick
    Participant

    Hi,

    I just tried to set the brightness of my screen using python and RPI.GPIO but it looks like that this kills the driver…

    Here is my Code:

    try:
        import RPi.GPIO as GPIO
    except RuntimeError:
        print("Error importing RPi.GPIO!")
        debuggerprint("Error importing RPi.GPIO!",1) 
    LCDBrightnessPin = 22
    GPIO.setmode(GPIO.BOARD) # Set to GPIO Name Mode
    GPIO.setup(LCDBrightnessPin, GPIO.OUT)
    p = GPIO.PWM(LCDBrightnessPin, 100)
    p.ChangeDutyCycle(60)

    The code compiles fine, but when I load it I get “Warning this Channel is already in use [blabla]” and the Screen is still at 100%.

    After I kill the application the screen turns black completly, but just a black picture, the Backlight intensity doesnt change. I then have to reboot the Pi to get the screen back to live.

    Any suggestions?

    Thanks!

    Patrick

    EDIT: Fixed it, hat to use Pin Number 15 instead of 22 ๐Ÿ™‚

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop…