ESP32-C3 (arduino-esp32) display on ST7735 SPI TFT using Adafruit ST7735 and ST7789 Library

This video show how Espressif ESP32-C3-DevKitM-1 (arduino-esp32) display on 1.8" 128x160 ST7735 SPI TFT, using Adafruit ST7735 and ST7789 Library.


Install Library

In Arduino IDE, open Library Manager to install "Adafruit ST7735 and ST7789 Library by Adafruit" and other library dependencies.

Connection

ST7735 SPI      ESP32-C3-DevKitM-1
------------------------------
VCC	        3V3
GND		GND
CS		10
RESET		9
A0	        8
SDA		6
SCK		4
LED		3V3
Run Example

Open and run Examples > Adafruit ST7735 and ST7789 Library > graphicstest


Comments

  1. Hello good morning;
    Sorry, my English is Google.
    I have a sp32 -S board "https://99tech.com.au/product/esp32-s3-yd/" this one.

    I try to connect a screen "ST7735 Full Color LCD Module"
    this "https://es.aliexpress.com/item/4001144194129.html?spm=a2g0o.order_list.order_list_main.178.3b36194dR8JKZ2&gatewayAdapt=glo2esp" 1.44 128x128 rgb_tft

    with the library "Adafruit ST7735 and ST7789 Library > graphicstest" and it does nothing with another ESP32 not S3 and with different pins it works but following your example it has not worked for me
    can you help me??
    many thanks.

    ReplyDelete
    Replies
    1. try this configuration // tradeoff being that performance is not as fast as hardware SPI above.
      #define TFT_MOSI 5 // Data out
      #define TFT_SCLK 17 // Clock out
      #define TFT_CS 15
      #define TFT_RST 26 // Or set to -1 and connect to Arduino RESET pin
      #define TFT_DC 14
      // For ST7735-based displays, we will use this call
      Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

      Delete
  2. Hi!

    Where did you get that Arduino sketch: "get_spi_info.ino"?

    Thanks!

    ReplyDelete
  3. #include


    //ST7735 SPI ESP32-C3-DevKitM-1
    //------------------------------
    //VCC 5V
    //GND GND
    //CS 10
    //RESET 4
    //DC 2
    //MOSI 11
    //SCK 12
    //LED 3V3

    // Pin tanımları
    #define CS_PIN 10
    #define RESET_PIN 4
    #define DC_PIN 2
    #define SCK_PIN 12
    #define MOSI_PIN 11

    // Ekran objesi (Donanım SPI kullanılıyor)
    Ucglib_ST7735_18x128x160_HWSPI ucg(DC_PIN, CS_PIN, RESET_PIN);

    unsigned long previousMillis = 0;
    const unsigned long interval = 5000;
    bool displayText = true;

    void setup() {
    // Ekranı başlat
    ucg.begin(UCG_FONT_MODE_TRANSPARENT);
    ucg.setFont(ucg_font_ncenB08_tr);
    ucg.setColor(255, 255, 255);
    }

    void loop() {
    unsigned long currentMillis = millis();

    // Zamanlayıcı ile ekran güncellemesi
    if (currentMillis - previousMillis >= interval) {
    previousMillis = currentMillis;
    displayText = !displayText;

    // Ekranı anında temizle (Tüm ekranı siyaha boyar)
    ucg.setColor(0, 0, 0); // Siyah renk
    ucg.drawBox(0, 0, 128, 160); // Ekranı temizle
    }

    // Yazı veya grafik göster
    if (displayText) {
    displayMessage();
    } else {
    displayGraph();
    }
    }

    void displayMessage() {
    ucg.setColor(255, 255, 255); // Beyaz renk
    ucg.setPrintPos(10, 30);
    ucg.print("Merhaba!");
    ucg.setPrintPos(10, 50);
    ucg.print("Nasılsınız?");
    }

    void displayGraph() {
    ucg.setColor(0, 255, 0); // Yeşil renk
    int centerY = 80;
    int amplitude = 30;
    int frequency = 10;

    // Sinüs grafiği çiz
    for (int x = 0; x < 128; x++) {
    int y = centerY + amplitude * sin((float)x / frequency);
    ucg.drawPixel(x, y);
    }
    }

    ReplyDelete

Post a Comment

Popular posts from this blog

480x320 TFT/ILI9488 SPI wih EP32C3 (arduino-esp32) using Arduino_GFX Library

my dev.tools - FNIRSI 2C23T 3-in-1 Dual Channel Oscilloscope/Multimeter/Signal Generator