Page 1 of 1

R61581 mirroring image/touch

Posted: Fri Mar 03, 2017 1:46 am
by protomor
I just got the new megaloggerHD and I'm trying to port over code from my old kit 3. Most things work fine out of the box but my old touch screen code (using Utouch and now URTouch) and my UTFT_SdRaw image loader is doing everything horizontally mirrored. I noticed the R61581.cpp file does some weird shifting when getting the x and y values and that the SetXY has the landscape orientation code commented out. This seems to work for most things.

I can get away with using the in built touch sensing but is there a way to fix the code so that the images load correctly?


UTFT_SdRaw myFiles(&lcd);
int result = myFiles.load(0, 0, ScreenWidth, ScreenHeight, "BG.raw");

Re: R61581 mirroring image/touch

Posted: Fri Mar 03, 2017 5:56 am
by protomor
Ok so I figured out the flip. Line 120 needs to be changed to 8A. Like this:

LCD_Write_COM(0x36);
//LCD_Write_DATA(0x0A);
LCD_Write_DATA(0x8A);

Now you can uncomment the landscape code in "SetXY". But now all of the characters are flipped. This is likely due to the original flip issue. So how to I flip the text back?

Re: R61581 mirroring image/touch

Posted: Mon Mar 13, 2017 10:26 pm
by protomor
Bump?

Re: R61581 mirroring image/touch

Posted: Tue Mar 14, 2017 4:10 am
by protomor
For anyone who wants it, here's the fixed code for the HD screen: https://drive.google.com/file/d/0ByBda7 ... sp=sharing

Basically, you change that one line and change everything else back to the SSD1289 code like the old screen. So far everything works as expected.

Re: R61581 mirroring image/touch

Posted: Wed Mar 15, 2017 11:05 am
by stanley
Thanks. Your modifications have been committed to github,