Problems with UTFT

Apologies I am new here and don't know how to post "code" :confused:

UPDATE:
I got the screen to display now using another calibration similar output to what I posted earlier, but touch is not working. :roll_eyes:

Hi cooldex,

Can you edit your post, and delete everything after

// ************************************
// DO NOT EDIT ANYTHING BELOW THIS LINE
// ************************************

It is not necessary since you have not edited anything below the line right? And since the calibration routine is included with the UTOUCH library we all know what we are talking about.

The first thing that immediately strikes me is line 6 of your code, line 21 of the Henning original

// Define the orientation of the touch screen. Further 
// information can be found in the instructions.
#define TOUCH_ORIENTATION  PORTRAIT

Did you notice the comment about more information in the instructions????? :wink:

If you had read those instructions you would have seen your problem!

Regards,

Graham

Hi Graham

That worked thanks.. yeah! I should have read that line. :-[
Thanks!

But the calibration is still not right. But I can get the demo's to work, so I guess it works. Now to get the code to control my aquarium LED's.

Hi cooldex,

I am not convinced of the wisdom of the diy breadboard style jumpers, but I can understand why some people do it (to allow easier access to unused pins). The problem of calibration figures being different every time, is that you are not touching the calibration points in the exact same places every time, it is typical the calibration constants will change, and they do, even though afterwards the button tests should still work..... One thing that seems to make quite a difference for me (even though this should only affect the larger screens!) is the use of an additional ac/dc power supply, 9V 500mA - 1A is ideal. Perform your calibration with a power supply and see if that improves things for you.

Also, Henning does say this on the instructions, but we know how well that worked out for you so far!! :wink: :stuck_out_tongue:

"Use a stylus or something similar to touch as close to the center of the highlighted crosshair as possible. Keep as still as possible.....

It makes a BIG difference to the results.

Then once you have edited your UTouchCD.h file, restart the IDE.

In your sketch, just use myTouch.InitTouch(); NOT myTouch.InitTouch(LANDSCAPE); This may be counterintuitive.....

Good luck.

Graham

I tried that and still the same.. the Calculator url reports the same. :drooling_face:

The calibration results cannot possibly be the same if you have changed your touch orientation to landscape in the cal sketch. Supply your new results please.

Regards,

Graham

Hi!

Here is the changes I made and results:

// Define the orientation of the touch screen. Further 
// information can be found in the instructions.
#define TOUCH_ORIENTATION  LANDSCAPE

// Initialize display
UTFT    myGLCD(ITDB43,38,39,40,41);

// Initialize touchscreen
UTouch  myTouch( 6, 5, 4, 3, 2);

and the results:

Displaytype : ITead Studio - ITDB02-4.3
Your CAL_X : 0x020347EFUL
Your CAL_Y : 0x01F847C3UL
Your CAL_S : 0x0010F1DFUL
Results:
• Orientation is not correct...
• CAL_X data sequence is not correct...
• CAL_Y data sequence is not correct...

Hi dex,

Something does not make any sense.......... even if you had run the calibration with the correct orientation, it is EXTREMELY UNLIKELY(impossible) the CAL_X CAL_Y results would be the same and I can absolutely guarantee your CAL_S would NOT be the same! So my question is, exactly what do you think you have done?

Sainsmart are renowned for including badly modified versions of Hennings libraries, and if you did not delete those before you installed the genuine libraries, it is highly likely you have conflicts.

I would suggest you remove ALL versions of UTFT/UTOUCH/UTFT_Buttons, and only install the latest versions of Hennings libraries. Download them all from here :-
UTFT
UTouch
UTFT_Buttons

The only changes you should need to make to UTouch_Calibration are :-

Line 21

#define TOUCH_ORIENTATION  LANDSCAPE

Line 34

UTFT    myGLCD(ITDB43,38,39,40,41);

WHEN you have got things working right, I can tell you with certainty your CAL_S figure WILL be 0x8010F1DFUL, once you have figured out how to get that right, then I would expect the CAL_X/CAL_Y figures to be correct also!

UTouch Calibration Data Verification

Displaytype : ITead Studio - ITDB02-4.3
Your CAL_X : 0x020347EFUL
Your CAL_Y : 0x01F847C3UL
Your CAL_S : 0x8010F1DFUL

Results:
• Orientation is correct...
• Display size parameters are not correct...
• CAL_X data sequence is not correct...
• CAL_Y data sequence is not correct...

As you can see, at least my CAL_S figure is confirmed! I do not have your model of display so I cannot produce valid figures for CAL_X/CAL_Y. You have not so far even managed to get the orientation correct, so either you have multiple versions of the calibration sketch and you are running the wrong one(sainsmart and henning libraries both installed??) or you have not changed TOUCH_ORIENTATION to LANDSCAPE, it is just not possible to produce your CAL_S figure with a LANDSCAPE TOUCH_ORIENTATION!!!!!!!

Do EXACTLY what I have advised, and if you still have CAL_S of 0x0010F1DFUL then I can not help you further.

Regards,

Graham

PS. If you are not already using IDE v1.5.x, I would seriously recommend you do! The following are sketch sizes for UTouch_Calibration.ino

IDE V1.0.5r2 25,164 bytes.
IDE V1.0.6 25,168 bytes.

IDE V1.5.7 19,050 bytes.
IDE V1.5.8 19,050 bytes.

There are other benefits to V1.5.X also, such as line numbers and extended memory useage statistics at compile time. eg

Sketch uses 19,050 bytes (7%) of program storage space. Maximum is 253,952 bytes.
Global variables use 1,430 bytes (17%) of dynamic memory, leaving 6,762 bytes for local variables. Maximum is 8,192 bytes.

Hi Graham
You right I swapped another LCD and the cal was as you said. I have sent back my faulty display. I am clean all lib's and started clean. Thanks! :slight_smile:

:grin: 8)

We got there eventually! :stuck_out_tongue: It would be nice if Sainsmart started adopting a less secretive approach and supplying modified versions of the UTFT libraries, it would stop many of these problems!!

Pleased I could help you.

Regards,

Graham

I,m using Mega 2560, ElecFreaks 2.2 shield and TFT320-QVT
I can run all the demo's no problem including touch. However when I try to display my
own Bitmaps - that have been converted (and small enough) - all I get is a frame of colored dots.
I even tried modifying an example (same result). Any thoughts? :confused:

Did you try my UTFT_SdRaw library?

Regards,

Graham