RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Brightness control via hotkey combination in RetroPie

    Scheduled Pinned Locked Moved Help and Support
    backlight pwm
    2 Posts 2 Posters 325 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • StonedEdgeS
      StonedEdge
      last edited by StonedEdge

      Hi guys,

      I’d like to control the duty cycle of my PWM signal on GPIO12 (Raspberry Pi CM4) to control the LED brightness of my 5” display with a hot key combination (ideally holding select, and then using up and down on the DPAD to control the duty cycle in 10 steps, for example) for my portable gaming handheld I’m building (currently using TPS61160 boost converter).

      Is there any python script or library to use to read the inputs of a generic USB controller via RetroArch? Ideally I’d just read the button inputs and time held in a script and then control the PWM signal output with a simple function.

      Any help or reference to simple documentation would be appreciated! Thank you.

      Check out my build logs below:
      Wii SPii (Wii in a GBA SP Shell)
      https://bitbuilt.net/forums/index.php?threads/the-wii-spii.3347/
      Retro Lite CM4
      https://bitbuilt.net/forums/index.php?threads/retro-lite-cm4-a-stonededge-and-dmcke5-collaboration.3934/

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        Use triggerhappy - https://github.com/wertarbyte/triggerhappy - it's already included in RasPI OS and you can just attach your PWM control scripts without having to deal with input processing.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.