#include <SPI.h>
#include <TFT_eSPI.h>
#include "User_Setup.h"
TFT_eSPI tft = TFT_eSPI();
const uint16_t colors[] = {
TFT_NAVY, TFT_DARKGREEN, TFT_DARKCYAN, TFT_MAROON, TFT_PURPLE,
TFT_OLIVE, TFT_LIGHTGREY, TFT_DARKGREY, TFT_BLUE, TFT_GREEN,
TFT_CYAN, TFT_RED, TFT_MAGENTA, TFT_YELLOW, TFT_WHITE,
TFT_ORANGE, TFT_GREENYELLOW, TFT_PINK, TFT_BROWN, TFT_GOLD,
TFT_SILVER, TFT_SKYBLUE, TFT_VIOLET, TFT_TRANSPARENT
};
const char* colorNames[] = {
"NAVY", "DARKGREEN", "DARKCYAN", "MAROON", "PURPLE",
"OLIVE", "LIGHTGREY", "DARKGREY", "BLUE", "GREEN",
"CYAN", "RED", "MAGENTA", "YELLOW", "WHITE",
"ORANGE", "GREENYELLOW", "PINK", "BROWN", "GOLD",
"SILVER", "SKYBLUE", "VIOLET", "TRANSPARENT"
};
const int NUM_COLORS = sizeof(colors) / sizeof(colors[0]);
static int colorIndex = 0;
void setup() {
Serial.begin(115200);
tft.init();
tft.setRotation(1);
tft.fillScreen(TFT_BLACK);
tft.setTextColor(TFT_RED);
tft.setTextSize(2);
tft.setCursor(40, 110);
tft.println("Hello GC9A01!");
// Okrąg 24px średnicy pośrodku
int cx = 120, cy = 119, r = 119;
tft.drawCircle(cx, cy, r, TFT_GREEN);
}
void loop() {
/*
uint16_t currentColorValue = colors[colorIndex];
const char* currentName = colorNames[colorIndex];
Serial.println(currentName);
tft.fillScreen(currentColorValue);
colorIndex = (colorIndex + 1) % NUM_COLORS;
delay(1000);
*/
}