Rotation Screen with the gyroscope of the UDOO Card

Discussion in 'UDOO NEO' started by Quenillet, Jun 15, 2017.

  1. Quenillet

    Quenillet New Member

    Joined:
    Jun 15, 2017
    Messages:
    2
    Likes Received:
    0
    Hello,

    I currently have an UDOO Neo card and a LVDS touchscreen.

    For my application, the card and the screen will be integrated in a same holder, to make something like a touchpad.

    So my question is : is it possible to rotate the display of the screen when we change the position of the screen ?

    Like a phone for example: when we turn the phone, the display switches to landscape mode.

    The UDOO card have a gyroscope, that's why I think it's possible to do that, if the card is at the same emplacement of the screen, but I don't know how to do this

    If somebody have an idea about that, thank you to share it here ! :)

    Have a nice day !

    (PS: Sorry if my english is not very good, i'm french :confused: )


    The sound must never stop.
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Off course it is possible, depends on your programming skills. The sensor is available through I2C so a subroutine in your program that creates the display could monitor the sensor and change orientation.

    What is the OS and programming language you are planning to use?
     
  3. Quenillet

    Quenillet New Member

    Joined:
    Jun 15, 2017
    Messages:
    2
    Likes Received:
    0
    Thank for your answer !

    I use Qt Creator to develop my program via a virtual machine with VirtualBox, and the OS is Ubuntu in 64bits

    So I think I have to create 2 views, one in "portrait mode", and one in "landscape mode", and make a subroutine somewhere in the program (i don't know yet where) like this :

    if the value returned by sensor = ...., display view1

    Do you agree ?
     
  4. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Yes.
    Did you already try to implement this QT developed program on a real Neo (in a very simple state, like "hello world") running Udoobuntu?
    Or are you going to run on a Yocto based OS?

    When running Udoobuntu (and probably Yocto too) you can use these instructions to read the sensors.
    You could also checkout the various libraries other users have made to get access to the sensors:
    For Python (but also check out the Java and Driver modules section): https://www.udoo.org/docs-neo/UDOO_NEO_made_by_the_Community/Python.html
     

Share This Page