Codey OnlineBiblioteka komponentów Arduino i ESP32 › 1.28" Round TFT LCD 240x240 (GC9A01, SPI)
1.28" Round TFT LCD 240x240 (GC9A01, SPI)
Wyświetlacze

1.28" Round TFT LCD 240x240 (GC9A01, SPI)

To okrągły moduł LCD TFT 1,28 cala z kontrolerem GC9A01 i rozdzielczością 240x240 pikseli. Zazwyczaj działa przez interfejs SPI i używa pinów sterujących, takich jak CS (chip select) i DC (data/command), a także RST (reset) oraz zasilania (VCC/GND).

Szerokość: 41 mm

Pinout — 1.28" Round TFT LCD 240x240 (GC9A01, SPI)

Pin Sygnał Opis
RST reset Active-low hardware reset input for the GC9A01 display controller.
CS chip-select SPI chip-select input for the display, typically active low.
DC digital Data/command select input; sets whether SPI bytes are commands or pixel data.
SDA MOSI SPI data input to the display controller, equivalent to MOSI.
SCL SCK SPI serial clock input for transferring commands and display data.
GND ground Ground reference for power and SPI logic signals.
VCC power Power supply input for the TFT LCD module.

Przykładowy schemat połączeń — 1.28" Round TFT LCD 240x240 (GC9A01, SPI)

Z Do Przewód
board:3V3 x1:VCC darkorange
board:GND x1:GND black
board:D18 x1:SCL green
board:D23 x1:SDA blue
board:D27 x1:DC yellow
board:D5 x1:CS purple
board:D4 x1:RST cyan

Przykładowy kod Arduino — 1.28" Round TFT LCD 240x240 (GC9A01, SPI)

Ten przykład został napisany i sprawdzony kompilacją dla esp32-devkit-v1. Codey Online dostosuje go do każdej innej obsługiwanej płytki.

#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_GC9A01A.h>

#define TFT_CS   5
#define TFT_DC   27
#define TFT_RST  4

Adafruit_GC9A01A tft(TFT_CS, TFT_DC, TFT_RST);

void drawHomeScreen() {
  tft.fillScreen(GC9A01A_BLACK);

  // Simple beginner-friendly demo graphics
  tft.fillCircle(120, 120, 102, GC9A01A_BLUE);
  tft.fillCircle(120, 120, 78, GC9A01A_BLACK);
  tft.drawCircle(120, 120, 110, GC9A01A_WHITE);

  tft.setTextColor(GC9A01A_WHITE);
  tft.setTextSize(2);
  tft.setCursor(60, 88);
  tft.println("GC9A01");
  tft.setCursor(36, 116);
  tft.println("Round TFT");
  tft.setCursor(34, 144);
  tft.println("ESP32 SPI");
}

void setup() {
  Serial.begin(115200);
  delay(200);

  Serial.println("Starting GC9A01 display demo...");

  // This library version uses initSPI(), not init()
  tft.initSPI();
  tft.setRotation(0);
  drawHomeScreen();

  Serial.println("Display initialized.");
}

void loop() {
  static bool shown = true;
  static uint32_t lastChange = 0;

  if (millis() - lastChange >= 1000) {
    lastChange = millis();
    shown = !shown;

    if (shown) {
      drawHomeScreen();
      tft.setTextColor(GC9A01A_YELLOW, GC9A01A_BLACK);
      tft.setCursor(74, 170);
      tft.println("ON");
      Serial.println("Screen: ON");
    } else {
      tft.fillRect(0, 160, 240, 40, GC9A01A_BLACK);
      tft.drawCircle(120, 120, 110, GC9A01A_RED);
      Serial.println("Screen: OFF highlight");
    }
  }
}

Podobne komponenty

1602 LCD DISPLAY

1602 LCD DISPLAY

1602 LCD I2C DISPLAY

1602 LCD I2C DISPLAY

8x8 RGB 64 LED Matrix 5V WS2812b

8x8 RGB 64 LED Matrix 5V WS2812b

LCD Display TFT 1.3inch ST7789

LCD Display TFT 1.3inch ST7789

Zbuduj swój projekt Arduino lub ESP32 z pomocą AI

Opisz, co chcesz zbudować. Codey Online napisze kod, narysuje schemat połączeń, skompiluje projekt i wgra go na płytkę bezpośrednio z przeglądarki.

Zacznij za darmo