MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. Bender352
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    B
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Groups 0

    Posts

    Recent Best Controversial
    • Rotating IR-Frame

      Hi,
      I struggled a little bit to rotate my IR-Frame to work with my mirror in portrait mode.
      So, I wrote this little guide to help you out. This is a guide from a noob to noobs ;)

      first if you want to rotate your screen, follow this instruction
      How to rotate your screen

      then open a command prompt on your raspberry

      now you must create a new folder

      mkdir ~/startup_scripts
      

      before we create a script, we need some information. Type this in your command prompt

      xinput -list
      

      it will show you something like this

      pic1.JPG

      this shows you the name of the IR-Frame, in my case it is IrScreen cc (yours could be different)

      open a 2nd command prompt, it is time to create our script

      type the following command

      nano ~/startup_scripts/portrait.sh
      

      enter this code

      xinput set-prop "THE NAME OF YOUR IF_FRAME" --type=float "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1
      

      now youmust enter the exact name of your IR-Frame in the code. In my case the code would look like this

      xinput set-prop “IrScreen cc” --type=float “Coordinate Transformation Matrix” 0 1 0 -1 0 1 0 0 1

      save and exit with Crtl+X and Y

      next step, make the script executable type

      sudo chmod +x ~/startup_scripts/portrait.sh 
      

      now we can test it type

      bash ~/startup_scripts/portrait.sh
      

      your IR-Frame should be set in the right orientation now,

      in case it is inverted then your screen is in portrait mode (rotated 90 clockwise)
      this will inverse the curser, open the portrait.sh file in the nano editor

      nano ~/startup_scripts/portrait.sh
      

      replace the numbers with the following
      0 -1 1 1 0 0 0 0 1

      and it should work for you

      now we only have to add some line to this on every startup of you raspberry.

      sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
      

      and add this line

      @lxterminal -e /home/pi/startup_scripts/portrait.sh
      

      123.JPG
      close and save it with Ctrl+X and Y

      all done

      if you like it, feel free for a up-vote or a comment

      posted in General Discussion
      B
      Bender352
    • 1 / 1