#include <DFRobot_GDL.h>
// Définition des broches SPI pour l'écran
#define TFT_DC D5
#define TFT_RST D4
#define TFT_MOSI D10
#define TFT_SCLK D8
#define TFT_CS D3
// Initialisation de l'écran avec SPI matériel
DFRobot_ILI9341_240x320_HW_SPI screen(/*dc=*/TFT_DC, /*cs=*/TFT_CS, /*rst=*/TFT_RST);
void setup() {
Serial.begin(115200);
// Initialisation de l’écran
screen.begin();
screen.setRotation(1); // rotation horizontale paysage
screen.fillScreen(COLOR_RGB565_BLACK); // fond noir
// Affichage du texte "Hello World"
screen.setTextColor(COLOR_RGB565_WHITE);
screen.setTextSize(3); // taille du texte
screen.setCursor(60, 120); // position (x, y)
screen.println("Hello World");
}
void loop() {
// Rien à faire en boucle
}
Loading
xiao-esp32-c3
xiao-esp32-c3