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

    Running accessing python .py program/file from within Retropie? Servo Servosix

    Scheduled Pinned Locked Moved Help and Support
    help and supporretropie 4.0.2pythonprojectcoding
    3 Posts 3 Posters 2.1k 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.
    • S
      subz
      last edited by

      Pi Model: 3
      RetroPie Version Used: 4.02
      Built From: (Pre made SD Image on RetroPie website)
      Controller used: Tht 2 player/ xin-mo 20 pin usb to jamma

      Hello, I am building an upright arcade cabinet with the pi 3 and retropie.
      I would like to auto-rotate the monitor with a servo depending on the games orientation.

      My goal is to auto-rotate the screen depending on orientation from within retropie.

      I would like to navigate to the servo.py python program from
      /home/pi/RetroPie/roms/arcade/romname.zip.cfg

      This .cfg is what i have used to rotate the pi picture 90 degrees per rom and I know retropie definatly 'reads' from this file as it loads the rom.

      I have little /no programing expierience I know the redirect is possible but I dont know
      how to get there.

      I have the monk makes servo controller for raspberry pi
      https://www.monkmakes.com/servo-kit/

      If I quit out retropie with f4 I can control the servo by navigating to the files and running the python .py file/program.

      Is it possible to open/run a .py file/program from within retropie and from the rom.zip.cfg file? then return to open the rom
      Also when exiting a game i need retropie to read and run a reset to landscape .py file to correct the orientation of the menus/gameslist?
      Im not sure where this should go?

      I know theres many programs like mrotate that are pc based for the job, are there any that are compatible with the pi 3

      Any advice will be appreciated
      Thanks

      1 Reply Last reply Reply Quote 0
      • K
        KPack
        last edited by

        I have the same issue. Did you find a solution?

        1 Reply Last reply Reply Quote 0
        • simonsterS
          simonster
          last edited by

          You may be able to launch your python script from the runcommand-onstart script and reset it with the runcommand-onend script.

          See: https://retropie.org.uk/docs/Runcommand/#runcommand-onstart-and-runcommand-onend-scripts

          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.