Hi David,
Thanks very much for the reply!
Still no luck, I have changed the code to this :
/*
* Rui Santos
* Complete Project Details http://randomnerdtutorials.com
*/
// 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);
Now I get the errors :-
Arduino: 1.8.10 Hourly Build 2019/04/18 12:33 (Windows 7), Board: "Arduino/Genuino Uno"
In file included from C:\Program Files (x86)\Microsoft Visual Studio\arduino-nightly\libraries\TFT\src/TFT.h:36:0,
from C:\Users\oem\Documents\Arduino\2nd_Display_Test\2nd_Display_Test.ino:7:
C:\Program Files (x86)\Microsoft Visual Studio\arduino-nightly\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."
^
2nd_Display_Test: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\2nd_Display_Test\2nd_Display_Test.ino:7:0:
C:\Program Files (x86)\Microsoft Visual Studio\arduino-nightly\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)\Microsoft Visual Studio\arduino-nightly\libraries\TFT\src/TFT.h:47:3: note: candidate expects 3 arguments, 5 provided
C:\Program Files (x86)\Microsoft Visual Studio\arduino-nightly\libraries\TFT\src/TFT.h:45:7: note: candidate: constexpr TFT::TFT(const TFT&)
class TFT : public Adafruit_ST7735 {
^
C:\Program Files (x86)\Microsoft Visual Studio\arduino-nightly\libraries\TFT\src/TFT.h:45:7: note: candidate expects 1 argument, 5 provided
C:\Program Files (x86)\Microsoft Visual Studio\arduino-nightly\libraries\TFT\src/TFT.h:45:7: note: candidate: constexpr TFT::TFT(TFT&&)
C:\Program Files (x86)\Microsoft Visual Studio\arduino-nightly\libraries\TFT\src/TFT.h:45:7: note: candidate expects 1 argument, 5 provided
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&)'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Also, I found a page that said that on a Uno type board SDA & SCL are on analog input pins A4 and A5.
The pinouts on the display board are A5 = cs, A4 = rst, A3 = rs, A2 = sda, A1 = scl
The trouble with looking for answers on the net can be so confusing as sometimes they disagree.
Sorry to be such a nuisance but I am just a beginner at this...8-((
Martin