UTouch won't compile (fixed - don't download from third parties)

Hi everyone!

I recently purchased a 3.2" TFT touch screen display with a shield and mega2560.

I have been trying to figure out how to get it all working but keep running into issues.

The UTFT library will run the demo's just fine but I can't get UTouch to compile. This is the error I get when I use the example 'ButtonTest'.

Arduino: 1.6.3 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Build options changed, rebuilding all

In file included from UTouch_ButtonTest.ino:14:0:

C:\Users\Leland\Dropbox\Arduino\libraries\UTouch/UTouch.h:44:3: error: 'word' does not name a type

   word TP_X ,TP_Y;

   ^

C:\Users\Leland\Dropbox\Arduino\libraries\UTouch/UTouch.h:65:3: error: 'word' does not name a type

   word touch_ReadData();

   ^

UTouch_ButtonTest.ino:27:16: error: 'ITDB32S' was not declared in this scope

UTouch_ButtonTest.ino: In function 'void updateStr(int)':

UTouch_ButtonTest.ino:103:14: error: call of overloaded '_delay_ms(int)' is ambiguous

UTouch_ButtonTest.ino:103:14: note: candidates are:

In file included from C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:91:0,

                 from UTouch_ButtonTest.ino:13:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\util\delay.h:142:1: note: void _delay_ms(double)

 _delay_ms(double __ms)

 ^

In file included from UTouch_ButtonTest.ino:13:0:

C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:102:15: note: void _delay_ms(long unsigned int)

 #define delay _delay_ms

               ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:134:6: note: in expansion of macro 'delay'

 void delay(unsigned long);

      ^

UTouch_ButtonTest.ino:105:14: error: call of overloaded '_delay_ms(int)' is ambiguous

UTouch_ButtonTest.ino:105:14: note: candidates are:

In file included from C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:91:0,

                 from UTouch_ButtonTest.ino:13:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\util\delay.h:142:1: note: void _delay_ms(double)

 _delay_ms(double __ms)

 ^

In file included from UTouch_ButtonTest.ino:13:0:

C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:102:15: note: void _delay_ms(long unsigned int)

 #define delay _delay_ms

               ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:134:6: note: in expansion of macro 'delay'

 void delay(unsigned long);

      ^

UTouch_ButtonTest.ino:107:14: error: call of overloaded '_delay_ms(int)' is ambiguous

UTouch_ButtonTest.ino:107:14: note: candidates are:

In file included from C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:91:0,

                 from UTouch_ButtonTest.ino:13:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\util\delay.h:142:1: note: void _delay_ms(double)

 _delay_ms(double __ms)

 ^

In file included from UTouch_ButtonTest.ino:13:0:

C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:102:15: note: void _delay_ms(long unsigned int)

 #define delay _delay_ms

               ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:134:6: note: in expansion of macro 'delay'

 void delay(unsigned long);

      ^

UTouch_ButtonTest.ino: In function 'void loop()':

UTouch_ButtonTest.ino:240:22: error: call of overloaded '_delay_ms(int)' is ambiguous

UTouch_ButtonTest.ino:240:22: note: candidates are:

In file included from C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:91:0,

                 from UTouch_ButtonTest.ino:13:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\util\delay.h:142:1: note: void _delay_ms(double)

 _delay_ms(double __ms)

 ^

In file included from UTouch_ButtonTest.ino:13:0:

C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:102:15: note: void _delay_ms(long unsigned int)

 #define delay _delay_ms

               ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:134:6: note: in expansion of macro 'delay'

 void delay(unsigned long);

      ^

UTouch_ButtonTest.ino:242:22: error: call of overloaded '_delay_ms(int)' is ambiguous

UTouch_ButtonTest.ino:242:22: note: candidates are:

In file included from C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:91:0,

                 from UTouch_ButtonTest.ino:13:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\util\delay.h:142:1: note: void _delay_ms(double)

 _delay_ms(double __ms)

 ^

In file included from UTouch_ButtonTest.ino:13:0:

C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:102:15: note: void _delay_ms(long unsigned int)

 #define delay _delay_ms

               ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:134:6: note: in expansion of macro 'delay'

 void delay(unsigned long);

      ^

UTouch_ButtonTest.ino:244:22: error: call of overloaded '_delay_ms(int)' is ambiguous

UTouch_ButtonTest.ino:244:22: note: candidates are:

In file included from C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:91:0,

                 from UTouch_ButtonTest.ino:13:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\util\delay.h:142:1: note: void _delay_ms(double)

 _delay_ms(double __ms)

 ^

In file included from UTouch_ButtonTest.ino:13:0:

C:\Users\Leland\Dropbox\Arduino\libraries\AVR_UTFT/UTFT.h:102:15: note: void _delay_ms(long unsigned int)

 #define delay _delay_ms

               ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:134:6: note: in expansion of macro 'delay'

 void delay(unsigned long);

      ^

Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

This is just the compile, not hardware related at all. Shouldn't this at least be compiling? Do I need to uninstall Arduino and use an earlier version? I am using the latest release.

I have other problems, but figure I'll work on one at time and then once I have those sorted I'll be able to dig deeper into other problems.

I have gone into the UTouch.h library and tried manually setting word to an unsigned int, but that didn't work. I tried manually including the arduino.h library, no luck. I checked and think that 'word' is defined in the arduino.h, I'm just not sure how to go about resolving it.

I appreciate any help!

Nevermind.

Don't download the library from third parties.
Once I downloaded directly from UTouch - Rinky-Dink Electronics
No more compiling issues.

sigh I've been fighting this for two days now. Why do people mess with perfectly good code and then repost it for download once they've broken it?

lmarklar:
sigh I've been fighting this for two days now. Why do people mess with perfectly good code and then repost it for download once they've broken it?

Sounds like the work of Sainsmartshit.... :stuck_out_tongue:

Regards,

Graham

It wasn't them, I picked up the display from eLabPeers. I sent them a message telling them their libraries are borked. So far the hardware has worked once I get the correct libraries, and the data sheets that they link are all from ITead directly, so I don't think it's sainsmart gear.

Now to see if I can get the touch screen working.... The shield looks very close to an itead, but says Lseeduino TFT Mega Shield v1.1. But it at least has buffers and a regulator on there.

Ah, so there is another company supplying bodged unofficial versions of Hennings libraries, I will almost certainly guarantee unlicenced just like Sainsmart.... And by god have I had enough 'fun?' helping people that bought Sainsmart gear THEN came to the forums when it didn't quite work as expected!!

The 'standard' pins for many of the MEGA touchscreens use pins 6,5,4,3,2 you got nothing to lose, but I would seriously recommend you read the UTOUCH manual pdf if your display is not DIRECTLY supported by UTFT!!

Most of the questions you are likely to ask are answered in that document.

Regards,

Graham

I can get the x,y coordinates to read, they are just off.

I did read the manual and go through the schematics. I’m not saying that the hardware documentation is great, or even good… but the pin outs do check out.

I have another thread with what I’ve found (since it wasn’t related to the original problem in this thread). But basically the x,y reads fine at the max 320,240, and reads all the way to 0,0, but there is about a 1" border in the 0,0 coordinates that just register as 0.

If someone can definitely say “That’s a hardware problem” then I’ll happily go back to the supplier and work on a resolution that way.

I would say run the touch calibration sketch, change your values in UTouchCD.h, restart the IDE and try again.

This is not USUALLY a problem on small screens such as yours, but maybe a problem with cheaper hardware, if you are quibbling over a few pixels, I think you are expecting too much.

Regards,

Graham