Trouble compiling examples for the UTFT Library

Everytime I try to compile any of the Demo applications that came with the UTFT Library from henningkarlsen, I get the following errors;

UTFT_Demo_400x240.pde:-1: error: 'UTFT' does not name a type
UTFT_Demo_400x240.cpp: In function 'void setup()':
UTFT_Demo_400x240.pde:-1: error: 'myGLCD' was not declared in this scope
UTFT_Demo_400x240.cpp: In function 'void loop()':
UTFT_Demo_400x240.pde:-1: error: 'myGLCD' was not declared in this scope
UTFT_Demo_400x240.pde:-1: error: 'CENTER' was not declared in this scope

I still suck at programming so I am kind of learning as I go along. Can anyone clue me in on what is going wrong?

Did you download and install the library in the correct place?

oh man I feel dumb. When I was placing the examples and the libraries in their respective folders, I accidentally swapped which ones went in their folders. So the Library went in the example folder and the examples went in the library folder. [facepalm]

The UTFT library is an example of very well written software, I bought one of those 3.2" 320X240 displays with a shield from Electrodragon ($14 or $15.00) compiled the examples for a Mega and was Very Pleasantly surprised. Everything works as advertised... I haven't tested the touch or SD card yet... But I am sure they will work as well as the rest does.

Doc

So far the graphics library seems pretty straight forward. I haven't had luck with the "Touch" library.

Good or bad?

Doc

So far the graphics portion of the library seem pretty good as well as simple to use. However, I have had some issues with displaying images. I don't know if it is me or a quirk in the library itself, I am trying to display an image that is 320px X 19px and so I call the command myGLCD.drawBitmap(0, 0, 320, 19, bitmap); (I find that strange since 0,0 - 320,19 would make the image 321px X 20px, but hey the manual shows 0,0 - 32,32 to draw a 32x32 image). The first image draws fine, but if I make that exact call again but on the bottom of the screen I get a lot of glitches on the screen.the image will draw on the top and bottom, but it also will make a box with the image in it twice and it will be all distorted. Sorry its 7:30am and I cant type this early in the morning.

EDIT: This is what it is doing.

Here is my code. (I would have just pasted the code in here, but the image C array would take up a lot of space. https://dl.dropbox.com/u/16622657/arduino/gui.zip

EDIT 2: I'm an idiot. I assumed sx and sy referred to the coordinates of the lower right corner of the image. It however, does not.

Did you RTFM? You know... READ That Fine Manual, first?. Henning is as far as I know very approachable as well, You might try there as well. I would.

Doc

lol ya I combed through it. I was just in such a hurry to try out this shiny new screen.

EDIT: Got the touch screen working. Its very nice. I just need to figure out how to use the SD card now

madz:
Everytime I try to compile any of the Demo applications that came with the UTFT Library from henningkarlsen, I get the following errors;

UTFT_Demo_400x240.pde:-1: error: 'UTFT' does not name a type

UTFT_Demo_400x240.cpp: In function ‘void setup()’:
UTFT_Demo_400x240.pde:-1: error: ‘myGLCD’ was not declared in this scope
UTFT_Demo_400x240.cpp: In function ‘void loop()’:
UTFT_Demo_400x240.pde:-1: error: ‘myGLCD’ was not declared in this scope
UTFT_Demo_400x240.pde:-1: error: ‘CENTER’ was not declared in this scope




I still suck at programming so I am kind of learning as I go along. Can anyone clue me in on what is going wrong?

I’m having the SAME errors running the examples. The UTFT library shows up if I try to manually import a library. I’m using the Mega 2560, a Sainsmart TFT shield, and the Sainsmart TFT320QVT 3.2 inch touchscreen. Even the libraries recommended by sainsmart don’t work correctly, as I get basically the same errors. Any ideas would be very useful. I have scoured many technical manuals, example code, and tried tons of various libraries with no luck. Thanks in advance

You must install the (UTFT) library: move it to My documents/Arduino/libraries.

Please help to resolve the following error:

UTFT_Bitmap.pde:-1: error: 'UTFT' does not name a type
UTFT_Bitmap.cpp: In function 'void setup()':
UTFT_Bitmap.pde:-1: error: 'myGLCD' was not declared in this scope
UTFT_Bitmap.cpp: In function 'void loop()':
UTFT_Bitmap.pde:-1: error: 'myGLCD' was not declared in this scope
UTFT_Bitmap.pde:-1: error: 'CENTER' was not declared in this scope

girish_nex:
Please help to resolve the following error:

UTFT_Bitmap.pde:-1: error: 'UTFT' does not name a type

UTFT_Bitmap.cpp: In function ‘void setup()’:
UTFT_Bitmap.pde:-1: error: ‘myGLCD’ was not declared in this scope
UTFT_Bitmap.cpp: In function ‘void loop()’:
UTFT_Bitmap.pde:-1: error: ‘myGLCD’ was not declared in this scope
UTFT_Bitmap.pde:-1: error: ‘CENTER’ was not declared in this scope

As noted above - you do not have the UTFT Library installed correctly.

i have same problem.
help me plz.
I already add utft library from add library option.
UTFT_Demo_400x240.ino:13:18: error: UTFT.h: No such file or directory
UTFT_Demo_400x240:31: error: ‘UTFT’ does not name a type
UTFT_Demo_400x240.ino: In function ‘void setup()’:
UTFT_Demo_400x240:38: error: ‘myGLCD’ was not declared in this scope
UTFT_Demo_400x240.ino: In function ‘void loop()’:
UTFT_Demo_400x240:50: error: ‘myGLCD’ was not declared in this scope
UTFT_Demo_400x240:58: error: ‘CENTER’ was not declared in this scope

UTFT.h: No such file or directory

This is big hint to consider. The compiler can’t find your library, so where did you put it?

saadbsohail: I already add utft library from add library option.

It might be in the right place OK but, if I recall correctly, you have to restart the Arduino IDE so that it can check where things are. Have you done that?

The answer is in the question "How did you unpack the UTFT.rar file?". When using 7Zip it asks "Unpack into UTFT?". You will then get a folder within a folder UTFT\UTFT. Moving UTFT\UTFT to Arduino\Libraries causes the problem as you'll get Arduino\libraries\UTFT\UTFT. Just move the inside folder so you get Arduino\libraries\UTFT.