Hi there!
I have purchased a cheap Chinese mcufriend 2.4-inch TFT display and after a long fuss, I have successfully got libraries and test it by compiling and running examples code given in libraries.
But After that I tried to compile my basic custom code but it doesn't compile...
I am a noob in terms of Arduino...Please help...
My code is-
#include <Adafruit_GFX.h>
#include <Adafruit_SPITFT.h>
#include <Adafruit_SPITFT_Macros.h>
#include <gfxfont.h>
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
void setup(void)
{
Serial.begin(9600);
uint16_t ID = tft.readID();
if (ID == 0xD3) ID = 0x9481;
tft.begin(ID);
tft.setRotation(0);
// put your setup code here, to run once:
}
void loop()
{
tft.fillScreen(WHITE);
// put your main code here, to run repeatedly:
}
During compiling it shows following error-
sketch_jan07a:36: error: 'tft' was not declared in this scope
tft.fillScreen(WHITE);
^
exit status 1
'tft' was not declared in this scope