Hi,
This is a very strange issue that I came across.
The program below will compile and work but only with a 2013 version of the TFT library by Enrico Gueli.
I do get some SD warnings but they are not for functions that I will be using.
My Arduino is connected to a Makehawk 1.44" display and it works!
After compiling with the latest TFT library I get the following errors, can anyone please explain why?
Thanks,
Martin
// include TFT and SPI libraries
#include <TFT.h>
#include <SPI.h>
// pin definition for Arduino UNO
#define cs A5
#define dc A3
#define mosi A2
#define sclk A1
#define rst A4
// create an instance of the library
// TFT TFTscreen = TFT(cs, dc, rst);
//TFT(cs, dc, mosi, sclk, rst);
TFT TFTscreen = TFT(A5, A3, A2, A1, A4);
void setup() {
//initialize the library
TFTscreen.begin();
// clear the screen with a black background
TFTscreen.background(0, 0, 0);
//set the text size
TFTscreen.setTextSize(2);
}
void loop() {
//generate a random color
int redRandom = random(0, 255);
int greenRandom = random (0, 255);
int blueRandom = random (0, 255);
// set a random font color
TFTscreen.stroke(redRandom, greenRandom, blueRandom);
pinMode(A0, OUTPUT);
digitalWrite(A0, HIGH); //switch backlight on
// print Hello, World! in the middle of the screen
TFTscreen.text("Hello, World!", 6, 57);
// wait 200 miliseconds until change to next color
delay(200);
}
In file included from C:\Program Files (x86)\arduino-1.8.9\libraries\TFT\src/TFT.h:36:0,
from C:\Users\oem\Documents\Arduino\Working_Version\Working_Version.ino:7:
C:\Program Files (x86)\arduino-1.8.9\libraries\TFT\src/utility/Adafruit_GFX.h:60:3: warning: #warning "The SD library was not found. loadImage() and image() won't be supported." [-Wcpp]
#warning "The SD library was not found. loadImage() and image() won't be supported."
^
Working_Version:20:39: error: no matching function for call to 'TFT::TFT(const uint8_t&, const uint8_t&, const uint8_t&, const uint8_t&, const uint8_t&)'
TFT TFTscreen = TFT(A5, A3, A2, A1, A4);
^
In file included from C:\Users\oem\Documents\Arduino\Working_Version\Working_Version.ino:7:0:
C:\Program Files (x86)\arduino-1.8.9\libraries\TFT\src/TFT.h:47:3: note: candidate: TFT::TFT(uint8_t, uint8_t, uint8_t)
TFT(uint8_t CS, uint8_t RS, uint8_t RST);
^
C:\Program Files (x86)\arduino-1.8.9\libraries\TFT\src/TFT.h:47:3: note: candidate expects 3 arguments, 5 provided
C:\Program Files (x86)\arduino-1.8.9\libraries\TFT\src/TFT.h:45:7: note: candidate: constexpr TFT::TFT(const TFT&)
class TFT : public Adafruit_ST7735 {
^
C:\Program Files (x86)\arduino-1.8.9\libraries\TFT\src/TFT.h:45:7: note: candidate expects 1 argument, 5 provided
C:\Program Files (x86)\arduino-1.8.9\libraries\TFT\src/TFT.h:45:7: note: candidate: constexpr TFT::TFT(TFT&&)
C:\Program Files (x86)\arduino-1.8.9\libraries\TFT\src/TFT.h:45:7: note: candidate expects 1 argument, 5 provided
Multiple libraries were found for "TFT.h"
Used: C:\Program Files (x86)\arduino-1.8.9\libraries\TFT
Not used: C:\Program Files (x86)\arduino-1.8.9\libraries\new display
Using library TFT at version 1.0.6 in folder: C:\Program Files (x86)\arduino-1.8.9\libraries\TFT
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\arduino-1.8.9\hardware\arduino\avr\libraries\SPI
exit status 1
no matching function for call to 'TFT::TFT(const uint8_t&, const uint8_t&, const uint8_t&, const uint8_t&, const uint8_t&)'