25 lines
578 B
C++
25 lines
578 B
C++
#include <Adafruit_GFX.h> // Core graphics library
|
|
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
|
|
#include <SPI.h>
|
|
|
|
#define TFT_CS 9
|
|
#define TFT_RST 10 // Or set to -1 and connect to Arduino RESET pin
|
|
#define TFT_DC 8
|
|
|
|
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
|
|
|
|
void setup(void) {
|
|
tft.initR(INITR_BLACKTAB);
|
|
tft.fillScreen(ST77XX_BLACK);
|
|
tft.setRotation(1);
|
|
|
|
}
|
|
|
|
void loop() {
|
|
tft.setCursor(0, 0);
|
|
tft.setTextColor(ST77XX_WHITE);
|
|
tft.setTextWrap(true);
|
|
tft.print("test");
|
|
delay(500);
|
|
}
|