adafruit tft display examples wont compile

errors galore when i try to run the adafruit examples
from here >>>>>> GitHub - adafruit/Adafruit_ILI9340: This is a library for the Adafruit 2.2" SPI display.


graphicstest.ino:19:30: error: Adafruit_ILI9340.h: No such file or directory
graphicstest:38: error: 'Adafruit_ILI9340' does not name a type
graphicstest.ino: In function 'void setup()':
graphicstest:46: error: 'tft' was not declared in this scope
graphicstest:58: error: 'ILI9340_CYAN' was not declared in this scope
graphicstest:62: error: 'ILI9340_RED' was not declared in this scope
graphicstest:62: error: 'ILI9340_BLUE' was not declared in this scope
graphicstest:66: error: 'ILI9340_GREEN' was not declared in this scope
graphicstest:70: error: 'ILI9340_YELLOW' was not declared in this scope
graphicstest:70: error: 'ILI9340_MAGENTA' was not declared in this scope
graphicstest:77: error: 'ILI9340_WHITE' was not declared in this scope
graphicstest.ino: In function 'void loop()':
graphicstest:101: error: 'tft' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testFillScreen()':
graphicstest:110: error: 'tft' was not declared in this scope
graphicstest:110: error: 'ILI9340_BLACK' was not declared in this scope
graphicstest:111: error: 'ILI9340_RED' was not declared in this scope
graphicstest:112: error: 'ILI9340_GREEN' was not declared in this scope
graphicstest:113: error: 'ILI9340_BLUE' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testText()':
graphicstest:119: error: 'tft' was not declared in this scope
graphicstest:119: error: 'ILI9340_BLACK' was not declared in this scope
graphicstest:122: error: 'ILI9340_WHITE' was not declared in this scope
graphicstest:124: error: 'ILI9340_YELLOW' was not declared in this scope
graphicstest:126: error: 'ILI9340_RED' was not declared in this scope
graphicstest:129: error: 'ILI9340_GREEN' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testLines(uint16_t)':
graphicstest:148: error: 'tft' was not declared in this scope
graphicstest:151: error: 'ILI9340_BLACK' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testFastLines(uint16_t, uint16_t)':
graphicstest:198: error: 'tft' was not declared in this scope
graphicstest:200: error: 'ILI9340_BLACK' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testRects(uint16_t)':
graphicstest:211: error: 'tft' was not declared in this scope
graphicstest:214: error: 'ILI9340_BLACK' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testFilledRects(uint16_t, uint16_t)':
graphicstest:228: error: 'tft' was not declared in this scope
graphicstest:231: error: 'ILI9340_BLACK' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testFilledCircles(uint8_t, uint16_t)':
graphicstest:247: error: 'tft' was not declared in this scope
graphicstest:249: error: 'ILI9340_BLACK' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testCircles(uint8_t, uint16_t)':
graphicstest:263: error: 'tft' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testTriangles()':
graphicstest:280: error: 'tft' was not declared in this scope
graphicstest:283: error: 'ILI9340_BLACK' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testFilledTriangles()':
graphicstest:299: error: 'tft' was not declared in this scope
graphicstest:302: error: 'ILI9340_BLACK' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testRoundRects()':
graphicstest:319: error: 'tft' was not declared in this scope
graphicstest:322: error: 'ILI9340_BLACK' was not declared in this scope
graphicstest.ino: In function 'long unsigned int testFilledRoundRects()':
graphicstest:336: error: 'tft' was not declared in this scope
graphicstest:339: error: 'ILI9340_BLACK' was not declared in this scope

and

spitftbitmap.ino:18:59: error: Adafruit_ILI9340.h: No such file or directory
spitftbitmap:36: error: 'Adafruit_ILI9340' does not name a type
spitftbitmap.ino: In function 'void setup()':
spitftbitmap:48: error: 'tft' was not declared in this scope
spitftbitmap:49: error: 'ILI9340_BLUE' was not declared in this scope
spitftbitmap.ino: In function 'void bmpDraw(char*, uint16_t, uint16_t)':
spitftbitmap:83: error: 'tft' was not declared in this scope
spitftbitmap:130: error: 'tft' was not declared in this scope
spitftbitmap:131: error: 'tft' was not declared in this scope
spitftbitmap:134: error: 'tft' was not declared in this scope

is there some reason they wont compile ??

Have you downloaded and installed the library as per the readme on the page you linked to? You need to re-start the arduino IDE after installing new libraries.

yes i did and tried this lot as well and they wont compile either despite adding the gfx files as well
all in the library file

knuckles:
yes i did and tried this lot as well and they wont compile either despite adding the gfx files as well
all in the library file

GitHub - adafruit/Adafruit-ST7735-Library: This is a library for the Adafruit 1.8" SPI display http://www.adafruit.com/products/358 and http://www.adafruit.com/products/618

Sorry, you must be doing something wrong. I just downloaded the library you linked to in your first post (Adafruit_ILI9340) and the Adafruit_GFX_Library from here, restarted the IDE and compiled both the example files (graphicstest & spitftbitmap) for the arduino UNO without error using the 1.0.5 version of the IDE.
I had to change the name of the GFX library to make it legal for the IDE as it was using - instead of _ in the name.

What version of IDE are you using?
What is your Arduino target device? (Mega, UNO etc.)

I downloaded, extracted, compiled the example right out of the blocks. (Already had the gfx library installed.)

Can't test, don't have the tft hardware....

Uno, ide 1.5.2 r2

its the tft model with the joystick and sim card reader on the uno board

http://www.hobbytronics.co.uk/arduino-tft-shield

i renamed the samples losing the - to the _

in the examples folder they went and show up in the ide menu as they should do

1.05 r2

baffled

here is my tree

knuckles:
its the tft model with the joystick and sim card reader on the uno board

The Adafruit library needed for this LCD is not the one you linked in the first post.
However, after downloading the library indicated on the product page from here, extracting to the libraries folder and renaming (I had to change the - to _) I could compile 7 of the 8 example sketches without any problems.
The one problem sketch (soft_spitftbitmap) error with

soft_spitftbitmap.ino: In function 'void setup()':
soft_spitftbitmap:68: error: no matching function for call to 'SDClass::begin(int, int, int, int)'
M:\DropboxPortableAHK\Dropbox_arduino-1.0.5\libraries\SD/SD.h:69: note: candidates are: boolean SDClass::begin(uint8_t)

so do not match your errors.

baffled as i followed the instructions to rename the files and then used add library feature so they would be right ,wierd

I did not use the install library option from the IDE but followed the Adafruit detailed practice of extracting the libraries to your libraries folder in your Arduino sketch folder.

just did em again manually, GFX and ST7735 and TFT downloaded, renamed and put into the lib file and still the same ,tons of errors .

C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp: In constructor 'RobotControl::RobotControl()':
C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp:8: error: 'LCD_CS' was not declared in this scope
C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp:8: error: 'DC_LCD' was not declared in this scope
C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp:8: error: 'RST_LCD' was not declared in this scope
C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp: In member function 'void RobotControl::begin()':
C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXA' was not declared in this scope
C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXB' was not declared in this scope
C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXC' was not declared in this scope
C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXD' was not declared in this scope
C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp:19: error: 'MUX_IN' was not declared in this scope
C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp:22: error: 'BUZZ' was not declared in this scope
C:\Program Files\Arduino\libraries\Robot_Control\ArduinoRobot.cpp:25: error: 'Serial1' was not declared in this scope

What has the Robot_Control library got to do with getting the display you linked to working?

i really dont know but thats the errors it spits out when i try to compile them , i was baffled by that too.

can some one post an example of their file tree that works .it must be a tiny error in the path

here is the prog (graphicstest ) that gives the errors above (shortened)

Check out the links above for our tutorials and wiring diagrams
These displays use SPI to communicate, 4 or 5 pins are required to
interface (RST is optional)
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!

Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution

  • ***************************************************/

// For the breakout, you can use any (4 or) 5 pins
//#define sclk 4
//#define mosi 5
//#define cs 6
//#define dc 7
//#define rst 8 // you can also connect this to the Arduino reset

//Use these pins for the shield!
#define sclk 13
#define mosi 11
#define cs 10
#define dc 8
#define rst 0 // you can also connect this to the Arduino reset

#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>

#if defined(SAM3X8E)
#undef __FlashStringHelper::F(string_literal)
#define F(string_literal) string_literal
#endif

// Option 1: use any pins but a little slower
Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst);

// Option 2: must use the hardware SPI pins
// (for UNO thats sclk = 13 and sid = 11) and pin 10 must be
// an output. This is much faster - also required if you want
// to use the microSD card (see the image drawing example)
//Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);
float p = 3.1415926;

#define Neutral 0
#define Press 1
#define Up 2
#define Down 3
#define Right 4
#define Left 5

// Check the joystick position
int CheckJoystick()
{
int joystickState = analogRead(3);

if (joystickState < 50) return Left;
if (joystickState < 150) return Down;
if (joystickState < 250) return Press;
if (joystickState < 500) return Right;
if (joystickState < 650) return Up;
return Neutral;
}

void setup(void) {
Serial.begin(9600);
Serial.print("hello!");

// Our supplier changed the 1.8" display slightly after Jan 10, 2012
// so that the alignment of the TFT had to be shifted by a few pixels
// this just means the init code is slightly different. Check the
// color of the tab to see which init code to try. If the display is
// cut off or has extra 'random' pixels on the top & left, try the
// other option!
// If you are seeing red and green color inversion, use Black Tab

// If your TFT's plastic wrap has a Black Tab, use the following:
tft.initR(INITR_BLACKTAB); // initialize a ST7735S chip, black tab
// If your TFT's plastic wrap has a Red Tab, use the following:
//tft.initR(INITR_REDTAB); // initialize a ST7735R chip, red tab
// If your TFT's plastic wrap has a Green Tab, use the following:
//tft.initR(INITR_GREENTAB); // initialize a ST7735R chip, green tab

Serial.println("init");

knuckles:
i really dont know but thats the errors it spits out when i try to compile them , i was baffled by that too.

can some one post an example of their file tree that works .it must be a tiny error in the path

What arduino are you trying to build these examples for and have you got this arduino selected in the Tools->Boards menu of the IDE.

yes of course it called up in the boards menu .

i tried an older copy of the ide i have on a laptop and the programs compile as they should without errors and upload ok but they dont activate the tft shield ,it stays dormant ...thats with it pluged in to the uno .
just using the example progs

knuckles:
i tried an older copy of the ide i have on a laptop and the programs compile as they should without errors and upload ok but they dont activate the tft shield ,it stays dormant ...thats with it pluged in to the uno .
just using the example progs

Seems there is something screwed up with your main PC's arduino install though not sure what. Maybe need to re-install it?
I don't have the hardware so can offer no help on why it's not working.

its ok for everything else and a daunting prospect to rebuild the ide , i may load on an earlier version as well ,and keep 2 ides, if they will cohabit

knuckles:
its ok for everything else and a daunting prospect to rebuild the ide , i may load on an earlier version as well ,and keep 2 ides, if they will cohabit

Download the zip version and you can extract it to where you want and have separate versions. I have a separate version for Teensy as it changed a lot of core libraries so wanted a vanilla version as well.

yeright but it brings with it the stinkin jungo drivers and they cause too much trouble with avrdude and a nuisance to get rid of them , i just got libusb sorted again and dont want them back , a new install will overide libusb with jungo again . i know i can switch them in properties