#include "SPI.h"
#include "ILI9341_t3.h"
#include <XPT2046_Touchscreen.h>
#include <font_LiberationSansNarrowBold.h>
#define TFT_DC 20 // TFT screen
#define TFT_CS 9 // TFT screen select for SPI
#define CS_PIN 15 // Touch panel select for SPI
// Use hardware SPI
ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC);
XPT2046_Touchscreen ts(CS_PIN);
void setup() {
Serial.begin(115200); // Set up serial port
ts.begin();
SPI.setSCK(13); // SCK pin default
SPI.begin(); // Setup and begin SPI library:
}
void loop() {
tft.begin(); // Initialize the display
tft.setRotation(3); // Rotate the display to be horizontal
tft.fillScreen(ILI9341_BLACK); // Clear the display
tft.setTextColor(ILI9341_RED); // Set the text color
tft.setFont(LiberationSansNarrow_16_Bold); // Set the font size
tft.setCursor(125, 20); // Set the curser position
tft.print("ViscoTron"); // Print the text
tft.setFont(LiberationSansNarrow_12_Bold); // Set the font size
tft.setTextColor(ILI9341_WHITE); // Set text color
tft.setCursor(160, 60); // Set the curser position
tft.print("by"); // Print the text
tft.setFont(LiberationSansNarrow_16_Bold); // Set the font size
tft.setTextColor(ILI9341_RED); // Set text color
tft.setCursor(70, 88); // set the cursor position
tft.print("Viscotronics Co., Ltd."); // Print the text
tft.setTextColor(ILI9341_WHITE); // Set text color
tft.setFont(LiberationSansNarrow_12_Bold); // Set the font size
tft.setCursor(125, 130); // Set the cursor positoon
tft.print("designed in"); // Print the text
tft.setFont(LiberationSansNarrow_16_Bold); // Set the font size
tft.setCursor(55, 160); // Set the cursor position
tft.print("British Columbia, Canada"); // Print the text
tft.setFont(LiberationSansNarrow_16_Bold); // Set the font size
tft.setCursor(65, 200); // Set the cursor position
tft.print("info@viscotronics.com"); // Print the text
delay(2000); // Delay 2 seconds
}