USING ARDUINO:
I have the library installed, the board manager installed also
I have selected the Seeeduino Wio Terminal as the board.
I have selected the Port (in my case 21) (Seeeduino Wio Terminal)
I open the serial monitor ok
I can write very simple programs like print etc and they run correctly, but any program trying to use the tft will hang. Here is your sample program modified with println statements to the serial console:
println statements stop after tft.init();
then the program hangs.
Please help.
Thanks
// Diagnostic test for the displayed colour order
//
// Writen by Bodmer 17/2/19 for the TFT_eSPI library:
// https://github.com/Bodmer/TFT_eSPI
#include <SPI.h>
#include <TFT_eSPI.h> // Hardware-specific library
TFT_eSPI tft = TFT_eSPI(); // Invoke custom library
void setup(void) {
Serial.begin(115200);
while(!Serial);
for(int i=0;i<10;i++)
Serial.println(i);
Serial.println(“TFT Init”);
tft.init();
Serial.println(“screen to black”);
delay(2000);
tft.fillScreen(TFT_BLACK);
delay(2000);
// Set “cursor” at top left corner of display (0,0) and select font 4
tft.setCursor(0, 0, 4);
delay(2000);
// Set the font colour to be white with a black background
tft.setTextColor(TFT_WHITE, TFT_BLACK);
delay(2000);
// We can now plot text on screen using the “print” class
tft.println(“Intialised default\n”);
tft.println(“White text”);
Serial.println(“white text”);
tft.setTextColor(TFT_RED, TFT_BLACK);
tft.println(“Red text”);
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.println("Green text");
Serial.println(“green text”);
tft.setTextColor(TFT_BLUE, TFT_BLACK);
tft.println(“Blue text”);
delay(5000);
}
void loop() {
Serial.println(“In loop”);
tft.invertDisplay(false); // Where i is true or false
tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0, 4);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.println("Invert OFF\n");
tft.println("White text");
tft.setTextColor(TFT_RED, TFT_BLACK);
tft.println("Red text");
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.println("Green text");
tft.setTextColor(TFT_BLUE, TFT_BLACK);
tft.println("Blue text");
delay(5000);
// Binary inversion of colours
tft.invertDisplay(true); // Where i is true or false
tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0, 4);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.println("Invert ON\n");
tft.println("White text");
tft.setTextColor(TFT_RED, TFT_BLACK);
tft.println("Red text");
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.println("Green text");
tft.setTextColor(TFT_BLUE, TFT_BLACK);
tft.println("Blue text");
delay(5000);
}