#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
// Pin TFT LCD
#define TFT_CS PA4
#define TFT_DC PB0
#define TFT_RST PB1
// Inisialisasi TFT
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
void setup() {
// Mulai komunikasi SPI dan TFT
tft.initR(INITR_BLACKTAB); // Inisialisasi TFT ST7735 (pakai tipe layar Black Tab)
tft.fillScreen(ST77XX_BLACK); // Bersihkan layar dengan warna hitam
tft.setTextSize(2); // Ukuran font 2x normal
tft.setTextColor(ST77XX_WHITE); // Warna font putih
tft.setCursor(10, 30); // Posisi teks di layar
tft.println("Halo STM32!"); // Tampilkan tulisan
}
void loop() {
// Tidak perlu update terus menerus di loop
}