valamit cookoltam, de szerintem oda is égett

This commit is contained in:
ivanovics 2025-04-17 22:16:58 +02:00
parent 3447262198
commit ffa4af5c37

62
ldc-ILI9488.ino Normal file
View File

@ -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 <MCUFRIEND_kbv.h>
#include <SPI.h>
#include <ILI9488.h>
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);
*/
}