#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <SPI.h>
#define TFT_CS 10
#define TFT_RST 8
#define TFT_DC 9
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
// Custom colors
#define SKY_BLUE tft.color565(0, 102, 204)
#define GROUND_BR tft.color565(153, 76, 0)
#define YELLOW ST77XX_YELLOW
#define WHITE ST77XX_WHITE
#define BLACK ST77XX_BLACK
void setup() {
tft.initR(INITR_BLACKTAB);
tft.setRotation(1); // Landscape
drawHorizon();
}
void loop() {
}
void drawHorizon() {
tft.fillScreen(BLACK);
// Center
int cx = 80;
int cy = 64;
// Sky
tft.fillRect(0, 0, 160, cy, SKY_BLUE);
// Ground
tft.fillRect(0, cy, 160, 128, GROUND_BR);
// Horizon line
tft.drawFastHLine(0, cy, 160, WHITE);
// Pitch lines (upper)
for (int i = 1; i <= 3; i++) {
int y = cy - (i * 15);
tft.drawFastHLine(cx - 20, y, 40, WHITE);
}
// Pitch lines (lower)
for (int i = 1; i <= 3; i++) {
int y = cy + (i * 15);
tft.drawFastHLine(cx - 20, y, 40, WHITE);
}
// Center yellow aircraft symbol
tft.fillRect(cx - 30, cy - 2, 20, 4, YELLOW);
tft.fillRect(cx + 10, cy - 2, 20, 4, YELLOW);
tft.drawLine(cx - 10, cy, cx, cy + 8, YELLOW);
tft.drawLine(cx, cy + 8, cx + 10, cy, YELLOW);
// Small center dot
tft.fillCircle(cx, cy, 3, YELLOW);
// Border circle (approx)
tft.drawCircle(cx, cy, 60, WHITE);
}