Go Down

Topic: Mega 2560 & 2.8 TFT Screen (Read 132 times) previous topic - next topic

tugozcan

Hello everyone,

I have Arudino Mega 2560 and ITDB02 2.8 TFT Touch Screen.
I try some codes and my connection is okey. it's works.

But, I want to use UTouch and UTFT libraries. But, I can't achieve it.
I guess there is a problem with declaration model.

UTFT  myGLCD(ITDB28,38,39,40,41);
UTouch myTouch(6,5,4,3,2);

In my code, I write declaration like the above.
Rest of the code is okey. I know. Because, I tried the code with Arduino UNO and 2.8 TFT Screen. It's works. But, I have the memory problem and I bought MEGA 2560. I changed only declaration part. Now it is not work with Mega.

What can be the problem? Is this declaration part true?

HazardsMind

So the same code works on an Uno, but not on a Mega. 

Can you provide a link to your display and the adapter shield (if you are using one).
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

tugozcan

So the same code works on an Uno, but not on a Mega.

Can you provide a link to your display and the adapter shield (if you are using one).
Exactly. Just declaration part is different.

I can't find my display screen link on itead website. I guess my screen is a little old one :)
But my tools exacly the same with this link;
http://www.avrfreaks.net/forum/arduino-mega-2560-and-28-itdb02-shield

tugozcan

In this link, they said:

4. Note to make use of UTFT code the first un-comment the line in below header file:
 
Arduino\libraries\UTFT\hardware\avr\HW_AVR_defines.h file when you use with 2.8 shield.

//#define USE_UNO_SHIELD_ON_MEGA 1

........

But I can't do that! How can I change the header file?? I open it with notebook, uncomment the that line but I can't save it ! My computer doesn't let that!

Driving me crazy...

HazardsMind

You will need to change the folder/files properties.  Locate the file, Right click and go down to properties, at the bottom you should see a check mark next to ReadOnly, go ahead and uncheck ReadOnly, then click Apply and OK.

If it still doesn't work then you will need to change the files individually. (same process)
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

tugozcan

You will need to change the folder/files properties.  Locate the file, Right click and go down to properties, at the bottom you should see a check mark next to ReadOnly, go ahead and uncheck ReadOnly, then click Apply and OK.

If it still doesn't work then you will need to change the files individually. (same process)
I did it! Thanks.
But Still there is a problem with UTouch Library!
When I use only UTFT library its works.
But if I add the UTouch library, it doesn't.

In my code, to use UTouch library I have to add:

  myTouch.InitTouch();
      myTouch.setPrecision(PREC_HI);

If I delete this code, i can display whatever I want, all display thing work but there is no touch !
Touch things don't work.
If I add this code, codes which are below the this part, don't work. codes, which are above the this code its work.

Do you have an opinion ?

HazardsMind

Does the Utouch library work when you are using the Uno?
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

Go Up