I struggled with a SainSmart 3.2 LCD and adapter card and then realized I had the libraries and examples in the wrong folders as well as the wrong model number. Using Sain Smart download (link below) or Henning's code I had the same problems - because I was making the same mistakes. Here was my solution:
So, the new auto import puts libraries where they need to be. Using
IDE Arduino 1.5.2 you can import the zip file ( Sketch|> Import Library|> Add Library...) the 32lcd.zip file from Sain Smart document needs to be renamed because it starts with a number so rename the zip to something like SS32lcd.zip. The automatic import of arduino 1.5.2 IDE will put the UTFT library files in the right place. You will still need to copy the example folder over to the example folder in the ....\arduino-1.5.2 IDE installed folder for them to show up in the File|>Examples|> menu. You can save your changes into your sketchbook and your customization will be preserved there.
http://www.sainsmart.com/sainsmart-3-2-tft-lcd-display-touch-panel-pcb-adapter-sd-slot-for-arduino-2560.html download link 2then change the line:
UTFT myGLCD(ITDB24E_16,38,39,40,41); // Remember to change the model parameter to suit your display module!
to the SSD1289 model for the Sain Smart unit
UTFT myGLCD(SSD1289,38,39,40,41); // Remember to change the model parameter to suit your display module!
resave this modified file to your sketchbook using File|>SaveAs
now the example UTFT_Demo_320x240.ino works!
Notes:
The IDE must be closed and restarted to see the new libraries and the Example files
Once you see how the auto library import install sets up the folders using the zip file you could use Henning's rar files extracted and moved to the same places - I haven't figured how to get the arduino import to accept a RAR file
Once you get all the linked libraries installed in the right folders you can open sketches from other locations BUT if the linked libraries have changes the IDE will still see the old versions you put in using the import feature.
Libraries in the wrong place will throw less than helpful compiler errors like :
'UTFT' does not name a typeLibraries with the same names in different folders could lead to using a different library than the one you have just downloaded or are expecting or the one you just modified but is in a different folder- be careful to watch directory structure and use new names
"Arduino Cookbook" by O'Reilly has some simple explanation of Libraries and directory structure CH 16 starting page 561