Pages: [1]   Go Down
Author Topic: Adafruit 2.8 TFT LCD Display Library Example Sketch Not Compiling  (Read 1734 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 71
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello and thank you all!
I'm new to LCD displays and I'm attempting to simply get an example code (part of the library) to compile.
I get an error: class 'Adafruit_TFTLCD' has no member named 'setCursor'
And  the line in the example code: "tft.setCursor(0, 0);" is highlighted.

At the top:
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library

Edit: Library downloaded from here: https://github.com/adafruit/TFTLCD-Library
I followed this tutorial: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use

As instructed, I went to my sketchbook, went to the libraries folder, and inserted the unzipped library into it. Here is the directory (My sketchbook is called Arduino Codes):
Arduino Codes\libraries\TFTLCDLibraryMaster

I redownloaded the entire library twice and I'm sure I have everything.
The header file Adafruit_TFTLCD
The C++ Source Code Adafruit_TFTLCD
Another header file called pin_magic
Examples, bitmatap, and a readme.

I attempted importing the standard LCD library.

The touchscreen library compiles. I'm not sure whats wrong with this one!
I'm at my wits end.
Please and thank you!

Edit: It is actually quite late here. I'm going to sleep. I appreciate all the help and will definately check here first thing tomorrow! (Or later today technically I guess)
Edit Edit: Just to cover all basis, I also did rename the file to 'TFTLCDLibraryMaster.' (Got rid of the dashes)
I also did this with the touch screen Library. Basically, I did exactly the same thing for both libraries and this one is not working.
« Last Edit: February 24, 2013, 10:56:16 am by 012anonymousxyz » Logged

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 71
Posts: 2614
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't have the hardware but downloaded the GitHub code you linked, extracted the zip, renamed the folder from 'Touch-Screen-Library-master' to 'TouchScreen' (to match the name of the .cpp & .h files in the folder) and placed it in the Arduino\libraries folder. Compiled both example sketches with no problem.
Logged


Offline Offline
Jr. Member
**
Karma: 0
Posts: 71
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I'm sorry.
I should have also mentioned it in my post, but as per the title, it is the LCD Display Library I'm having trouble with.
The touchscreen library also compiles for me.

Edit: Rats, I linked the wrong one. I'm sorry.
Here is the real link: https://github.com/adafruit/TFTLCD-Library

Also changed it in my original post.
« Last Edit: February 24, 2013, 10:56:37 am by 012anonymousxyz » Logged

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 71
Posts: 2614
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The readme file in the TFTLCD-Library download says you also need the Adafruit_GFX library from here and to also get the last 2 example to also compile you need the TouchScreen library from here.
Remember to rename the directories to the same name as the .cpp or .h file within the directory (without the filename extension).
So 'TFTLCD-Library-master' becomes 'Adafruit_TFTLCD' etc
Logged


Offline Offline
Jr. Member
**
Karma: 0
Posts: 71
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, thanks a lot!
I needed the core graphics library.

Renaming the folders doesn't matter though It can be whatever I want. Just the C++ filename should be the same. But yeah! It compiles now. Thanks a lot!
Logged

Pages: [1]   Go Up
Jump to: