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?
Announcement
Collapse
No announcement yet.
Best way to rotate screen 180 degrees
Collapse
X
-
Goldelox image rotation is not straight forward.
Note that when you 'paste code' you get a different result depending on the projects screen rotation.
But since you can only have 'one' orientation for a project you will need 4 separate projects and place the GCI files at different offsets on the uSD. You can do this using scriptc and the WriteUsd script. You should then be able to address the individual images from SerialMark
Comment
-
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 FilesMark
Comment
-
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; 13 September 2017, 01:32 AM.
Comment
-
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 ViSiMark
Comment
-
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.
Comment
Comment