/*
Happy Birthday für Margrit.
*/
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
//--------------------------------------------
void setup() {
tft.begin();
}
//--------------------------------------------
void loop() {
tft.setCursor(70, 60);
tft.setTextColor(random(0xFFFF));
tft.setTextSize(3);
tft.println("HAPPY");
delay(200);
tft.setCursor(50, 120);
tft.setTextColor(random(0xFFFF));
tft.setTextSize(3);
tft.println("BIRTHDAY");
delay(200);
tft.setCursor(25, 200);
tft.setTextColor(random(0xFFFF));
tft.setTextSize(2);
tft.println("liebe Margrit !!!");
delay(200);
drawHeart(120, 280, 20, tft.color565(random(255 + 1), 0, 0));
delay(200);
}
//--------------------------------------------
void drawHeart(int16_t x, int16_t y, int16_t size, uint16_t color) {
int16_t r = size / 2;
tft.fillCircle(x - r, y - r, r, color);
tft.fillCircle(x + r, y - r, r, color);
tft.fillTriangle(x - size, y - r + 3, x + size, y - r + 3, x, y + size, color);
}