Announcement

Collapse
No announcement yet.

Best way to rotate screen 180 degrees

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • jmracepoint
    started a topic Best way to rotate screen 180 degrees

    Best way to rotate screen 180 degrees

    The design I am working on has an accelerometer to determine the display orientation. What is the best way to handle this in the Goldelox code? I will tell the display with a serial command which orientation it should be in. I tried toggling gfx_Set(SCREEN_MODE,LANDSCAPE) with gfx_Set(SCREEN_MODE,LANDSCAPE_R), but the images don't rotate, only their placement. Is it best to add another form with everything inverted?

  • Pearl
    replied
    Hi again James,

    Directly getting the contents of a string object using a query at GTX is not possible.

    However, you can still implement the altering of the output printed on the screen by using the Magic Object.

    Kindly refer to the example attached as for your reference.

    sample2.zip

    Best Regards,
    Pearl

    Leave a comment:


  • James_IMS
    replied
    Hi Pearl,

    I have question about strings: I would like to be able to read string values as my LDC versions.

    For example, on my first LCD version, I'd need a string to default display "1" on the screen. Then for the second version, I'd need the string to default display "2" on the screen.

    Screen displays "1"
    GTX reads "Strings Value [05 11 07 00 01 12]"

    Screen displays "2"
    GTX reads "Strings Value [05 11 07 00 02 12]"

    I would like to use GTX to read the string value (query) (I don't want to need to set the string each time) and have it display a 'least significant byte' that has the same hex digit as the number displayed on the screen.

    When I try to do this though, the default string value is always "00".

    How could I make this happen?

    Thank you again!

    James

    Leave a comment:


  • James_IMS
    replied
    Thank you so much, Pearl!

    James

    Leave a comment:


  • Pearl
    replied
    Hi James,

    As you want to design your project in Visi-Genie environment, you can use Genie Magic codes to achieve it.

    As a reference, you can use the sample project attached which demonstrates how to be able to flip the screen orientation using a button.

    sample.zip

    Hope it helps.

    Best Regards,
    Pearl

    Leave a comment:


  • James_IMS
    replied
    Hi Everyone,

    I am currently working on a gen4-uLCD-43DT with Diablo16 and Visi-Genie. I would like to be able to use an image or button [press] to flip my screen [landscape] 180 degrees [landscape reversed] (and be able to rotate it back to its original orientation). How would I be able to do so, while staying in the genie environment?
    I know that I could use Magic Codes (magic code, magic touch), but I'm don't know how to properly code what I'd like to do.

    Thank you!

    James

    Leave a comment:


  • ESPsupport
    replied
    Same as before, any offset that makes it easy for you (to remember) in your program, they just need to be enough to ensure that the files don't overlap.

    Leave a comment:


  • jmracepoint
    replied
    Thanks, what do I use for offsets for the additional files in the script?

    Leave a comment:


  • ESPsupport
    replied
    You need the GCI for each orientation.

    The .g01 is a font and the .txf is strings. These come from a strings object. You will need the .g01 once. You only need the .txf if you used string constants. Just add them to the copy script the same way as you did the other files.

    Leave a comment:


  • jmracepoint
    replied
    Thanks, it was an issue with the uSD card and parallels. Now that part is working, however, my gui isn't working. When I compile the gui normally through the IDE, it wants to copy DIM0.g01, DIM0.gci, and DIM0.txf. Do I need to copy all of these files for each display orientation? If so, how do I determine the relative offsets in the script.

    Leave a comment:


  • ESPsupport
    replied
    At the surface a "Data error" should mean something is wrong with the uSD, but somehow I suspect another cause.

    Are you running the script from an Admin mode prompt? (Windows will prevent access if that is not the case, I get 'access denied', but if your uSD driver comes from a different vendor who knows what error they are reporting in this case)
    Are the specified offsets definitely withing the capacity of the card?
    Could your AV be getting involved? (Some try to be too clever)

    Yes, you can do the same thing from ViSi

    Leave a comment:


  • jmracepoint
    replied
    I am getting CRC errors:

    No Errors, code size = 40 bytes
    Starting Script WriteUSDGoldy.4dscript
    Log Command Times
    Data error (cyclic redundancy check)
    Data error (cyclic redundancy check)
    ABORTING Script WriteUSDGoldy.4dscript

    Any ideas?

    Also, is it possible to do the same thing from within a VISI project (as opposed to serial)? Currently, our main processor sends several variables and the VISI code determines what to display based on that information. The main processor does not determine which images go where directly.
    Last edited by jmracepoint; 13th September 2017, 12:32 AM.

    Leave a comment:


  • ESPsupport
    replied
    Yes, that will work for them

    Leave a comment:


  • jmracepoint
    replied
    How would I handle built-in widgets like the progress bar graph (or even custom widgets using the smart objects)? Will this work as intended or will they animate backwards? I am not sure how to generate the bar graphs in reverse.

    Leave a comment:


  • ESPsupport
    replied
    I've attached a file containing four projects that are simply the same image in different orientations. I've done a 'paste code' in each, so you can see the required positioning on the media_image commands.

    It also contains a script to copy the 4 different GCIs to a single uSD card, refer to the comments in the script for more information.

    Here's a commented Serial Commander log that demonstrates how the images can be used
    Code:
    media_Init[FFB1 ] 0.147 (ACK 1 0x0001)   // media needs initialising
    ... various commands
    gfx_ScreenMode[FF68 0000] 0.007 (ACK)  // display needs to be in Landscape orientation before displaying an image
    media_SetSector[FFB8 0000 0000] 0.009 (ACK)  // set sector 0, location of first, Landscape mode, image
    media_Image[FFB3 0008 0008] 0.017 (ACK)  // show image at position indicated by results of 'Paste code'
    ... various commands
    gfx_ScreenMode[FF68 0000] 0.007 (ACK) // display needs to be in Landscape orientation before displaying an image
    media_SetSector[FFB8 0000 0064] 0.009 (ACK) // set sector 100, location of second, Landscape Reversed mode, image
    media_Image[FFB3 0050 0050] 0.017 (ACK) // show image at position indicated by results of 'Paste code'
    ... various commands
    gfx_ScreenMode[FF68 0000] 0.007 (ACK) // display needs to be in Landscape orientation before displaying an image
    media_SetSector[FFB8 0000 00C8] 0.009 (ACK) // set sector 200, location of third, Portrait mode, image
    media_Image[FFB3 0008 0050] 0.017 (ACK) // show image at position indicated by results of 'Paste code'
    ... various commands
    gfx_ScreenMode[FF68 0000] 0.007 (ACK) // display needs to be in Landscape orientation before displaying an image
    media_SetSector[FFB8 0000 012C] 0.009 (ACK) // set sector 300, location of fourth, Portrait Reversed mode, image
    media_Image[FFB3 0050 0008] 0.017 (ACK) // show image at position indicated by results of 'Paste code'
    ... various commands
    Attached Files

    Leave a comment:

Working...
X