diff --git a/ldc-ILI9488.ino b/ldc-ILI9488.ino new file mode 100644 index 0000000..d0ffd62 --- /dev/null +++ b/ldc-ILI9488.ino @@ -0,0 +1,62 @@ + + +/* + A3 (CS) -> LCD CS + A2 (CD/RS)-> LCD DC + A1 (WR) -> LCD WR + A0 (RD) -> LCD RD + RESET -> ARDUINO RESET (vagy 5V, LOW->RESET, HIGH->NINCS RESET) +*/ +#include +#include +#include + +MCUFRIEND_kbv tft; +uint16_t ID; + +void setup() { + ID = tft.readID(); + if (ID == 0xD3D3) ID = 0x9488; // ugyanaz mint a másik + + // init + tft.begin(ID); + + // 1=90 fokkal forgi + tft.setRotation(1); + + // Clear screen + tft.fillScreen(0x000000); +} + +void loop() { + // test pattern + tft.fillScreen(0xFFFFFF); + + // Draw vertical red lines every 20 pixels + for (uint16_t x = 0; x < tft.width(); x += 20) { + tft.drawFastVLine(x, 0, tft.height(), 0xFF0000); + } + + // 20 pixelenként zöld csík + for (uint16_t y = 0; y < tft.height(); y += 20) { + tft.drawFastHLine(0, y, tft.width(), 0x00FF00); + } + + // Draw centered text + tft.setTextSize(4); + tft.setTextColor(0X0000FF); + uint16_t x = (tft.width() - (6 * 16)) / 2; // Approximate centering for 6 chars + uint16_t y = (tft.height() - (8 * 4)) / 2; + tft.setCursor(x, y); + tft.print("Helló világ! adjatok sört pls :3"); + + delay(3000); + + /* + Színmegfordítosmanőver + tft.invertDisplay(true); + delay(1000); + tft.invertDisplay(false); + delay(1000); + */ +} \ No newline at end of file