R61581 mirroring image/touch

Inquiry and support for Freematics products
Post Reply
protomor
Posts: 99
Joined: Wed Oct 14, 2015 9:17 am

R61581 mirroring image/touch

Post 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");
protomor
Posts: 99
Joined: Wed Oct 14, 2015 9:17 am

Re: R61581 mirroring image/touch

Post 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?
protomor
Posts: 99
Joined: Wed Oct 14, 2015 9:17 am

Re: R61581 mirroring image/touch

Post by protomor »

Bump?
protomor
Posts: 99
Joined: Wed Oct 14, 2015 9:17 am

Re: R61581 mirroring image/touch

Post 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.
stanley
Site Admin
Posts: 1018
Joined: Sat Mar 01, 2014 3:15 am

Re: R61581 mirroring image/touch

Post by stanley »

Thanks. Your modifications have been committed to github,
Post Reply