#include <Adafruit_GFX.h> // https://github.com/adafruit/Adafruit-GFX-Library
#include <Adafruit_ST7735.h> // https://github.com/adafruit/Adafruit-ST7735-Library
#include <SPI.h>
const int TFT_CS = 7;
const int TFT_DC = 6;
const int TFT_MOSI = 3;
const int TFT_SCLK = 2;
const int TFT_RST = 10;
const int TFT_BACKLIGHT = 11;
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
float p = 3.1415926;
void setup(void) {
Serial.begin(9600);
Serial.print(F("Hello! ST77xx TFT Test"));
tft.initR(INITR_BLACKTAB); //initialize the chip
tft.fillScreen(ST7735_BLACK); //fill screen with black
tft.setTextWrap(true);
//writing first text
tft.setCursor(0,0);
tft.setTextColor(ST7735_GREEN);
tft.setTextSize(3); // Set text size. Goes from 0 (the smallest) to 20 (very big)
tft.println("Hello");
tft.setCursor(0,50);
tft.setTextColor(ST7735_RED);
tft.setTextSize(3);
tft.println("World");
tft.drawRect(0, 60,60,30,ST7735_CYAN);
}
void loop() {
}