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

    Have a light only turn on while Retropie/EmulationStation is running

    Scheduled Pinned Locked Moved Help and Support
    retropiegpio
    7 Posts 5 Posters 1.5k 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.
    • TriquickT
      Triquick
      last edited by

      Recently I bought the NES case for Raspberry Pi 3 from Old Skool Tools. I really like it and appreciate that it has a cutout to add a light to make it just like the original NES. In the past I have wired up a simple light but it would come on (and stay on) while the system had power, even if Retropie had finished shutting down and wasn't running.

      What I really want to do is have a light come on while emulation station/retropie is running and shut off after its done shutting down (but the system is still plugged in). What is the best way to start?

      edmaul69E O 2 Replies Last reply Reply Quote 0
      • edmaul69E
        edmaul69 @Triquick
        last edited by

        @triquick wire the led to the bottom side of a usb port. The usb port shut off when you do the power down.

        1 Reply Last reply Reply Quote 1
        • B
          barrymossel
          last edited by

          Maybe a PowerBlock circuit. The Pi can remain plugged while you can use a button to turn it on and off. The led will turn on and off with it (and even has certain patterns when booting and shutting down.

          1 Reply Last reply Reply Quote 0
          • O
            ortsac @Triquick
            last edited by

            @triquick I would suggest PowerBlock as well. Check it out on this site:
            https://blog.petrockblock.com/2015/07/04/powerblock-another-power-switch-for-the-raspberry-pi/

            1 Reply Last reply Reply Quote 0
            • TriquickT
              Triquick
              last edited by

              Would it be worth it to try to create a two scripts

              1. One that turns the light on, and have the Retropie startup script call it?
              2. One that turns off the light, and have the Retropie shutdown script to call it?

              Or would that be to much of hassle dealing with updates to the startup/shutdown script?

              1 Reply Last reply Reply Quote 0
              • A
                Aryetis
                last edited by

                Assuming that your led is powered by a GPIO pin you can write two quick programs with wiringpi to turn it on and off. Then call those programs using rc script : https://www.raspberrypi.org/documentation/linux/usage/rc-local.md

                ( I believe scripts for shutdown are at /etc/rc0.d )

                1 Reply Last reply Reply Quote 0
                • TriquickT
                  Triquick
                  last edited by

                  @Aryetis Great, thanks, that was exactly what I was looking for.

                  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.