Problem mit TFT ST7735S_4L_80160 Umstieg von Arduino auf ESP32

Ich habe für mein Projekt nicht viel Platz für ein Display und deshalb habe ich mir ein sehr kleines 80x160 geholt. Library ist die UTFT.h Begonnen habe ich mein Projekt mit einem Arduino nano und hat auch sehr gut funktioniert. Bis mir der Speicher für den Sketch nicht mehr gereicht hat. Also bin ich auf den Arduino Mega mini umgestiegen und habe den Sketch fertig geschrieben. Für mein Projekt ist der Mega mini aber baulich zu groß. Also ist der nächste Schritt den Sketch auf einem ESP32 lauffähig zu bekommen. Taster und andere Peripherie habe ich hinbekommen. Aber das Display ärgert mich.

Beim Arduino ist der Hintergrund nach dem Initialisieren schwarz und auch sonst funktioniert alles wie es soll. Beim ESP32 bekomme ich einen weißen Hintergrund, die Farben sind alle anders als sie sein sollen und Schrift wird gar nicht angezeigt.

Lt. Recherche muß ich die UTFT-ESP.h verwenden - habe ich gemacht - funktioniert aber nicht.
Umstieg auf TFT_eSPI-h wird oft erwähnt, ist aber vom Code ganz anders aufgebaut und ich müßte mein ganzes Prog aufwändig umgestalten.

Meine Frage: Hat jemand Ahnung warum das Display mit dem ESP32 so anders anzeigt als mit dem Arduino? Und wie ich das mit UTFT.h so hinbekommen kann, daß es genauso funktioniert wie beim Arduino?

Dann würde ich mich MEGA freuen !!!

Display ist das hier:
https://www.amazon.de/0-96-ST7735-display-module-80x160/dp/B0C7GPRKJY

Ich verwende diese UTFT.h:
https://github.com/gnulabis/UTFT-ESP

So sieht das aktuell aus:



Beim Arduino lautet die Displayinitialisierung so:
`// Initialize display
//SDI=11 SCL=12 /CS =10 /RST=8 D/C=9
UTFT myGLCD(ST7735S_4L_80160,11,12,10,8,9);
void setup(){
myGLCD.InitLCD();
}

void loop(){
myGLCD.drawRect(0, 13, 159, 113);
}
`

Beim ESP32 sieht das so aus:
`// Initialize display
//UTFT myGLCD(MODEL, SDA_PIN, SCL_PIN, CS_PIN, RST_PIN, DC_PIN)
UTFT myGLCD(ST7735S, 23, 18, 5, 4, 2);
void setup(){
myGLCD.InitLCD();
}

void loop(){
myGLCD.drawRect(0, 13, 159, 113);
}
`

Wenn das ist das untere PRG dann sind es nur ein Parr Zeilen für das Display.

#include <UTFT.h>
#include <EEPROM.h>

// Declare which fonts we will be using
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
// Initialize display
//SDI=11  SCL=12  /CS =10  /RST=8  D/C=9
UTFT myGLCD(ST7735S_4L_80160, 11, 12, 10, 8, 9);

// Buttons (anpassen)
const int BTN_MENU = 3;
const int BTN_UP = 4;
const int BTN_DOWN = 5;
const int BTN_SELECT = 6;

int i;
bool Selecting = false;

int values[2];
String menu1Items[] = {
  "Menu 1-1",
  "Menu 1-2"
};
String menu2Items[] = {
  "Menu 2-1",
  "Menu 2-2",
  "EXIT"
};

int menuIndex = 0; // Pos im Menü nach Upload
int menuPage = 1; // Auswahl Menüseite nach Upload
int maxMenu1Items = 1; // Einträge jeder Menüseite, 1 = 2 Einträge
int maxMenu2Items = 2; // Einträge jeder Menüseite, 2 = 3 Einträge

void setup() {

  // Setup the LCD
  myGLCD.InitLCD(1);
  myGLCD.clrScr();
  myGLCD.setFont(SmallFont);
  myGLCD.setColor(255, 255, 255);

  pinMode(BTN_MENU, INPUT_PULLUP);
  pinMode(BTN_UP, INPUT_PULLUP);
  pinMode(BTN_DOWN, INPUT_PULLUP);
  pinMode(BTN_SELECT, INPUT_PULLUP);

  EEPROM.update(0, 1); // INITIALISIERUNG DES EEPROM Platzes, nach 1. Upload auskommentieren
  EEPROM.update(1, 1); // INITIALISIERUNG DES EEPROM Platzes, nach 1. Upload auskommentieren

  if (menuPage == 1) displayMenu1();
  if (menuPage == 2) displayMenu2();
}

void loop() {

  if (buttonPressed(BTN_UP)) {
    if (!Selecting) {
      menuIndex = (menuIndex - 1);
      if (menuIndex < 0) menuIndex = 0;
      if (menuPage == 1) displayMenu1();
      if (menuPage == 2) displayMenu2();
    } else {
      values[menuIndex]++;
      if (menuPage == 1) displayMenu1Select();
      if (menuPage == 2) displayMenu2Select();
    }
    delay(200);
  }

  if (buttonPressed(BTN_DOWN)) {
    if (!Selecting) {
      menuIndex = (menuIndex + 1);
      if (menuPage == 1) {
        if (menuIndex > maxMenu1Items) menuIndex = maxMenu1Items;
        displayMenu1();
      }
      if (menuPage == 2) {
        if (menuIndex > maxMenu2Items) menuIndex = maxMenu2Items;
        displayMenu2();
      }
    } else {
      values[menuIndex]--;
      if (menuPage == 1) displayMenu1Select();
      if (menuPage == 2) displayMenu2Select();
    }
    delay(200);
  }

  if (buttonPressed(BTN_SELECT)) {
    Serial.println(menuPage);
    if (menuPage == 1) displayMenu1Select();
    if (menuPage == 2) Selecting = !Selecting;
    displayMenu2Select();
    delay(200);
  }
}

bool buttonPressed(int pin) {
  return digitalRead(pin) == LOW;
}

void displayMenu1() {
  Serial.println(menuIndex);
  myGLCD.setColor(255, 255, 255);
  for (i = 0; i <= maxMenu1Items; ++i)
    if (menuIndex == i) {
      myGLCD.setColor(0, 0, 255);
      myGLCD.print(menu1Items[i], 15, i * 15 + 20);
    }
  else {
    myGLCD.setColor(255, 255, 255);
    myGLCD.print(menu1Items[i], 15, i * 15 + 20);
  }
}

void displayMenu1Select() {
  menuPage = 2;
  menuIndex = 0;
  myGLCD.clrScr();
  displayMenu2();
}

void displayMenu2() {

  values[0] = EEPROM.read(0);
  values[1] = EEPROM.read(1);

  myGLCD.setColor(255, 255, 255);
  for (i = 0; i <= maxMenu2Items; ++i) {
    if (menuIndex == i) {
      myGLCD.setColor(0, 0, 255);
      myGLCD.print(menu2Items[i], 15, i * 15 + 20);
    } else {
      myGLCD.setColor(255, 255, 255);
      myGLCD.print(menu2Items[i], 15, i * 15 + 20);
    }
    if (i < maxMenu2Items) {
      if (values[menuIndex] == 0) {
        myGLCD.setColor(255, 0, 0);
        myGLCD.print("OFF", 90, i * 15 + 20);
      }
      if (values[menuIndex] == 1) {
        myGLCD.setColor(0, 255, 0);
        myGLCD.print("ON ", 90, i * 15 + 20);
      }
    }
  }
}

void displayMenu2Select() {

    if (menuIndex == 0) {
      values[menuIndex] = 1 - values[menuIndex];
      if (values[menuIndex] == 0) {
        myGLCD.setColor(255, 0, 0);
        myGLCD.print("OFF", 90, menuIndex * 15 + 20);
      }
      if (values[menuIndex] == 1) {
        myGLCD.setColor(0, 255, 0);
        myGLCD.print("ON ", 90, menuIndex * 15 + 20);
      }
      EEPROM.update(0, values[menuIndex]);
      Selecting = 0;
    }
    if (menuIndex == 1) {
      values[menuIndex] = 1 - values[menuIndex];
      if (values[menuIndex] == 0) {
        myGLCD.setColor(255, 0, 0);
        myGLCD.print("OFF", 90, menuIndex * 15 + 20);
      }
      if (values[menuIndex] == 1) {
        myGLCD.setColor(0, 255, 0);
        myGLCD.print("ON ", 90, menuIndex * 15 + 20);
      }
      EEPROM.update(1, values[menuIndex]);
      Selecting = 0;
    }
    if (menuIndex == maxMenu2Items) {
      Selecting = 0;
      menuPage = 1;
      menuIndex = 0;
      myGLCD.clrScr();
      displayMenu1();
    }
  }

Vor allem was für ESP32 ist das, es gibt ganze Familie, und vor allem für Display das ESP Core auf die 2.0.17 Version rücksetzen, die UTFT-ESP ist schon über 7J Alt da gab es noch nicht die IDE 2,3.8, so wie ESP Core höher als 1.xx.

Auch die TFT_eSPI hat gerne Core nicht höher als 3.0.1

Ich meine, hab noch ein Display mit ST7735 rumliegen, dann kann dir Nachmittag helfen

Tja was soll ich schreiben?
Habe extra die UTFT-ESP installiert und ersten besten Beispiel gestartet

// UTFT_Demo_160x128_Serial_HW
// Copyright (C)2015 Dimitris Lampridis. All right reserved
//
// based on original UTFT_Demo_160x128_Serial:
// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved
// web: http://www.RinkyDinkElectronics.com/
//
// This program is a demo of how to use most of the functions
// of the library with a supported display module.
//
// This demo was made for modules with a screen resolution
// of 160x128 pixels.
//
// This demo implements the serial interface via hardware.
//
// This program requires the UTFT library.
//

#include <UTFT.h>
#include <SPI.h> // not necessary if Arduino IDE version >=1.6.6

// Declare which fonts we will be using
extern uint8_t SmallFont[];

// Modify the line below to match your display and wiring:
//UTFT(byte model, int CS, int RST, int DC)
UTFT myGLCD ( ST7735S, 15, 2, 4 );  // Meine  Einstellungen 

void setup (  ) {
    randomSeed ( analogRead ( 0 ) );

    // Setup the LCD
    myGLCD.InitLCD (  );
    myGLCD.setFont ( SmallFont );
}

void loop (  ) {
    int buf[158];
    int x, x2;
    int y, y2;
    int r;

    // Clear the screen and draw the frame
    myGLCD.clrScr (  );

    myGLCD.setColor ( 255, 0, 0 );
    myGLCD.fillRect ( 0, 0, 159, 13 );
    myGLCD.setColor ( 64, 64, 64 );
    myGLCD.fillRect ( 0, 114, 159, 127 );
    myGLCD.setColor ( 255, 255, 255 );
    myGLCD.setBackColor ( 255, 0, 0 );
    myGLCD.print ( String("Universal TFT Lib."), CENTER, 1 );
    myGLCD.setBackColor ( 64, 64, 64 );
    myGLCD.setColor ( 255, 255, 0 );
    myGLCD.print ( String("H.Karlsen"), LEFT, 114 );
    myGLCD.print ( String("(C)2015"), RIGHT, 114 );

    myGLCD.setColor ( 0, 0, 255 );
    myGLCD.drawRect ( 0, 13, 159, 113 );

    // Draw crosshairs
    myGLCD.setColor ( 0, 0, 255 );
    myGLCD.setBackColor ( 0, 0, 0 );
    myGLCD.drawLine ( 79, 14, 79, 113 );
    myGLCD.drawLine ( 1, 63, 158, 63 );

    for ( int i = 9; i < 150; i += 10 )
        myGLCD.drawLine ( i, 61, i, 65 );
    for ( int i = 19; i < 110; i += 10 )
        myGLCD.drawLine ( 77, i, 81, i );

    yield (  );

    // Draw sin-, cos- and tan-lines
    myGLCD.setColor ( 0, 255, 255 );
    myGLCD.print ( String("Sin"), 5, 15 );
    for ( int i = 1; i < 158; i++ ) {
        myGLCD.drawPixel ( i, 63 + ( sin ( ( ( i * 2.27 ) * 3.14 ) / 180 ) * 40 ) );
    }

    yield (  );

    myGLCD.setColor ( 255, 0, 0 );
    myGLCD.print ( String("Cos"), 5, 27 );
    for ( int i = 1; i < 158; i++ ) {
        myGLCD.drawPixel ( i, 63 + ( cos ( ( ( i * 2.27 ) * 3.14 ) / 180 ) * 40 ) );
    }

    yield (  );

    myGLCD.setColor ( 255, 255, 0 );
    myGLCD.print ( String("Tan"), 5, 39 );
    for ( int i = 1; i < 158; i++ ) {
        myGLCD.drawPixel ( i, 63 + ( tan ( ( ( i * 2.27 ) * 3.14 ) / 180 ) ) );
    }

    delay ( 2000 );

    myGLCD.setColor ( 0, 0, 0 );
    myGLCD.fillRect ( 1, 14, 158, 113 );
    myGLCD.setColor ( 0, 0, 255 );
    myGLCD.setBackColor ( 0, 0, 0 );
    myGLCD.drawLine ( 79, 14, 79, 113 );
    myGLCD.drawLine ( 1, 63, 158, 63 );

    // Draw a moving sinewave
    x = 1;
    for ( int i = 1; i < ( 158 * 20 ); i++ ) {
        x++;
        if ( x == 159 )
            x = 1;
        if ( i > 159 ) {
            if ( ( x == 79 ) || ( buf[x - 1] == 63 ) )
                myGLCD.setColor ( 0, 0, 255 );
            else
                myGLCD.setColor ( 0, 0, 0 );
            myGLCD.drawPixel ( x, buf[x - 1] );
        }
        myGLCD.setColor ( 0, 255, 255 );
        y = 63 + ( sin ( ( ( i * 2.5 ) * 3.14 ) / 180 ) * ( 40 - ( i / 100 ) ) );
        myGLCD.drawPixel ( x, y );
        buf[x - 1] = y;

        yield (  );
    }

    delay ( 2000 );

    myGLCD.setColor ( 0, 0, 0 );
    myGLCD.fillRect ( 1, 14, 158, 113 );

    // Draw some filled rectangles
    for ( int i = 1; i < 6; i++ ) {
        switch ( i ) {
        case 1:
            myGLCD.setColor ( 255, 0, 255 );
            break;
        case 2:
            myGLCD.setColor ( 255, 0, 0 );
            break;
        case 3:
            myGLCD.setColor ( 0, 255, 0 );
            break;
        case 4:
            myGLCD.setColor ( 0, 0, 255 );
            break;
        case 5:
            myGLCD.setColor ( 255, 255, 0 );
            break;
        }
        myGLCD.fillRect ( 39 + ( i * 10 ), 23 + ( i * 10 ), 59 + ( i * 10 ), 43 + ( i * 10 ) );
    }

    delay ( 2000 );

    myGLCD.setColor ( 0, 0, 0 );
    myGLCD.fillRect ( 1, 14, 158, 113 );

    // Draw some filled, rounded rectangles
    for ( int i = 1; i < 6; i++ ) {
        switch ( i ) {
        case 1:
            myGLCD.setColor ( 255, 0, 255 );
            break;
        case 2:
            myGLCD.setColor ( 255, 0, 0 );
            break;
        case 3:
            myGLCD.setColor ( 0, 255, 0 );
            break;
        case 4:
            myGLCD.setColor ( 0, 0, 255 );
            break;
        case 5:
            myGLCD.setColor ( 255, 255, 0 );
            break;
        }
        myGLCD.fillRoundRect ( 99 - ( i * 10 ), 23 + ( i * 10 ), 119 - ( i * 10 ), 43 + ( i * 10 ) );
    }

    delay ( 2000 );

    myGLCD.setColor ( 0, 0, 0 );
    myGLCD.fillRect ( 1, 14, 158, 113 );

    // Draw some filled circles
    for ( int i = 1; i < 6; i++ ) {
        switch ( i ) {
        case 1:
            myGLCD.setColor ( 255, 0, 255 );
            break;
        case 2:
            myGLCD.setColor ( 255, 0, 0 );
            break;
        case 3:
            myGLCD.setColor ( 0, 255, 0 );
            break;
        case 4:
            myGLCD.setColor ( 0, 0, 255 );
            break;
        case 5:
            myGLCD.setColor ( 255, 255, 0 );
            break;
        }
        myGLCD.fillCircle ( 49 + ( i * 10 ), 33 + ( i * 10 ), 15 );
    }

    delay ( 2000 );

    myGLCD.setColor ( 0, 0, 0 );
    myGLCD.fillRect ( 1, 14, 158, 113 );

    // Draw some lines in a pattern
    myGLCD.setColor ( 255, 0, 0 );
    for ( int i = 14; i < 113; i += 5 ) {
        myGLCD.drawLine ( 1, i, ( i * 1.44 ) - 10, 112 );
    }
    yield (  );

    myGLCD.setColor ( 255, 0, 0 );
    for ( int i = 112; i > 15; i -= 5 ) {
        myGLCD.drawLine ( 158, i, ( i * 1.44 ) - 12, 14 );
    }
    yield (  );

    myGLCD.setColor ( 0, 255, 255 );
    for ( int i = 112; i > 15; i -= 5 ) {
        myGLCD.drawLine ( 1, i, 172 - ( i * 1.44 ), 14 );
    }
    yield (  );

    myGLCD.setColor ( 0, 255, 255 );
    for ( int i = 15; i < 112; i += 5 ) {
        myGLCD.drawLine ( 158, i, 171 - ( i * 1.44 ), 112 );
    }

    delay ( 2000 );

    myGLCD.setColor ( 0, 0, 0 );
    myGLCD.fillRect ( 1, 14, 158, 113 );

    // Draw some random circles
    for ( int i = 0; i < 100; i++ ) {
        myGLCD.setColor ( random ( 255 ), random ( 255 ), random ( 255 ) );
        x = 22 + random ( 116 );
        y = 35 + random ( 57 );
        r = random ( 20 );
        myGLCD.drawCircle ( x, y, r );
    }

    delay ( 2000 );

    myGLCD.setColor ( 0, 0, 0 );
    myGLCD.fillRect ( 1, 14, 158, 113 );

    // Draw some random rectangles
    for ( int i = 0; i < 100; i++ ) {
        myGLCD.setColor ( random ( 255 ), random ( 255 ), random ( 255 ) );
        x = 2 + random ( 156 );
        y = 16 + random ( 95 );
        x2 = 2 + random ( 156 );
        y2 = 16 + random ( 95 );
        myGLCD.drawRect ( x, y, x2, y2 );
    }

    delay ( 2000 );

    myGLCD.setColor ( 0, 0, 0 );
    myGLCD.fillRect ( 1, 14, 158, 113 );

    // Draw some random rounded rectangles
    for ( int i = 0; i < 100; i++ ) {
        myGLCD.setColor ( random ( 255 ), random ( 255 ), random ( 255 ) );
        x = 2 + random ( 156 );
        y = 16 + random ( 95 );
        x2 = 2 + random ( 156 );
        y2 = 16 + random ( 95 );
        myGLCD.drawRoundRect ( x, y, x2, y2 );
    }

    delay ( 2000 );

    myGLCD.setColor ( 0, 0, 0 );
    myGLCD.fillRect ( 1, 14, 158, 113 );

    for ( int i = 0; i < 100; i++ ) {
        myGLCD.setColor ( random ( 255 ), random ( 255 ), random ( 255 ) );
        x = 2 + random ( 156 );
        y = 16 + random ( 95 );
        x2 = 2 + random ( 156 );
        y2 = 16 + random ( 95 );
        myGLCD.drawLine ( x, y, x2, y2 );
    }

    delay ( 2000 );

    myGLCD.setColor ( 0, 0, 0 );
    myGLCD.fillRect ( 1, 14, 158, 113 );

    for ( int i = 0; i < 5000; i++ ) {
        myGLCD.setColor ( random ( 255 ), random ( 255 ), random ( 255 ) );
        myGLCD.drawPixel ( 2 + random ( 156 ), 16 + random ( 95 ) );
        yield (  );
    }

    delay ( 2000 );

    myGLCD.fillScr ( 0, 0, 255 );
    myGLCD.setColor ( 255, 0, 0 );
    myGLCD.fillRoundRect ( 10, 17, 149, 72 );

    myGLCD.setColor ( 255, 255, 255 );
    myGLCD.setBackColor ( 255, 0, 0 );
    myGLCD.print ( String("That's it!"), CENTER, 20 );
    myGLCD.print ( String("Restarting in a"), CENTER, 45 );
    myGLCD.print ( String("few seconds..."), CENTER, 57 );

    myGLCD.setColor ( 0, 255, 0 );
    myGLCD.setBackColor ( 0, 0, 255 );
    myGLCD.print ( String("Runtime: (msecs)"), CENTER, 103 );
    myGLCD.printNumI ( millis (  ), CENTER, 115 );

    delay ( 10000 );
}

OK mein Display ist 128 X 160, was aber nichts zu Sagen hat.

Danke FONY !!!
Ich habe diesen ESP32 bei ebay gekauft - keine Ahnung, was das für eine Version ist. Ich bin da noch newbie und dachte es gibt nur einen...
https://www.ebay.de/itm/317665795063

Hier mal eine Übersicht der ESP32 Varianten vom Hersteller Espressif.

Hier kann man Vergleiche zwischen den Typen anstellen.

Gruß Tommy

Es ist "Normaler" ESP32 nur mit USB C, angesprochen wird er als ESP32 Dev Module.
SO wie geschrieben nutze das ESP32 Core 2.0.17, als IDE die 1.8.19 meistens als Portable. Damit habe auch die UTFT- ESP getestet, jedoch bleibe bei TFT_eSPI, kann viel mehr als die anderen, und dazu ist ach sehr schnell wen man Interne Schriftarten nutzt.
Die UTFT hat in UTFT.h auch die meist genutzte Farben.
es lohnt sich immer in die .h Datei ( hier UTFT.h) schauen

// VGA color palette
#define VGA_BLACK		0x0000
#define VGA_WHITE		0xFFFF
#define VGA_RED			0xF800
#define VGA_GREEN		0x0400
#define VGA_BLUE		0x001F
#define VGA_SILVER		0xC618
#define VGA_GRAY		0x8410
#define VGA_MAROON		0x8000
#define VGA_YELLOW		0xFFE0
#define VGA_OLIVE		0x8400
#define VGA_LIME		0x07E0
#define VGA_AQUA		0x07FF
#define VGA_TEAL		0x0410
#define VGA_NAVY		0x0010
#define VGA_FUCHSIA		0xF81F
#define VGA_PURPLE		0x8010
#define VGA_TRANSPARENT	0xFFFFFFFF

deklariert werden mit zB.

myGLCD.setColor(VGA_SILVER);

oder
myGLCD.setColor(0xC618);

Es ist besser vollen Color Nahmen nutzen dann weiß man auch nach gewisser Zeit was ist gemeint.

Vielen Dank für die Antworten!
Hilft mir aber nicht wirklich weiter!
Mit der TFT_eSPI müßte ich alle Displayanweisungen umprogrammieren...
Ich habe halt alles in diesem Format aufgebaut und wäre schön, wenn das so bleiben würde:
myGLCD.setColor(255, 255, 255);
myGLCD.print("Hello World", CENTER, 40);

Es muß doch eine Möglichkeit geben, das was ich jetzt mit dem Arduino Mega habe, auf ein baulich kleineres Format zu bekommen?
Ich habe gerade dieses Teil hier gefunden:
Arduino Nano Esp32 Without Headers
Vielleicht klappt das ja damit, wenn es von Arduino ist besser?

Mit einem 128x128 Display funktioniert das Beispielprogrmm farblich auch richtig. Aber Text wird trotzdem keiner angezeigt. Bei dir FONY? Ich brauche aber unbedingt das kleine 80x160 Display...




Dann machst du da noch einen Fehler, den wir hier nicht sehen können.
Da macht es erstmal keinen Sinn, andere Boards zu probieren.
Zeige doch bitte mal den aktuellen Sketch, den du verwendest.
Bitte komplett und in Code-Tags, damit dieser richtig lesbar ist.

Du könntest auch das Beispiel von @fony aus Post#3 testen.

Ich habe dein Display nicht, kann also nicht testen.
Du solltest aber mal diese Zeile:

UTFT myGLCD(ST7735S_4L_80160, 23, 18, 5, 4, 2);

anstatt dieser:

UTFT myGLCD(ST7735S, 23, 18, 5, 4, 2);

verwenden.

Das habe ich schon probiert. Da kommt dann diese Fehlermeldung:
'ST7735S_4L_80160' was not declared in this scope

Hier der kpl. Sketch den ich verwende:

#include <UTFT.h>

// UTFT myGLCD(MODEL, SDA_PIN, SCL_PIN, CS_PIN, RST_PIN, DC_PIN)
UTFT myGLCD(ST7735S, 23, 18, 5, 4, 2); 

// Schriftart definieren
extern uint8_t SmallFont[];

void setup() {
  // Display initialisieren
  myGLCD.InitLCD();
  myGLCD.clrScr();
}

void loop()
{
  int buf[158];
  int x, x2;
  int y, y2;
  int r;

// Clear the screen and draw the frame
  myGLCD.clrScr();

  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRect(0, 0, 159, 13);
  myGLCD.setColor(64, 64, 64);
  myGLCD.fillRect(0, 114, 159, 127);
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.print("pmdway.com.", CENTER, 1);
  myGLCD.setBackColor(64, 64, 64);
  myGLCD.setColor(255,255,0);
  myGLCD.print("pmdway.com", LEFT, 114);


  myGLCD.setColor(0, 0, 255);
  myGLCD.drawRect(0, 13, 159, 113);

// Draw crosshairs
  myGLCD.setColor(0, 0, 255);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.drawLine(79, 14, 79, 113);
  myGLCD.drawLine(1, 63, 158, 63);
  
 myGLCD.setColor(0, 0, 255);
 myGLCD.drawLine(0, 79, 159, 79);
 
  for (int i=9; i<150; i+=10)
    myGLCD.drawLine(i, 61, i, 65);
  for (int i=19; i<110; i+=10)
    myGLCD.drawLine(77, i, 81, i);
    

// Draw sin-, cos- and tan-lines  
  myGLCD.setColor(0,255,255);
  myGLCD.print("Sin", 5, 15);
  for (int i=1; i<158; i++)
  {
    myGLCD.drawPixel(i,63+(sin(((i*2.27)*3.14)/180)*40));
  }
  
  myGLCD.setColor(255,0,0);
  myGLCD.print("Cos", 5, 27);
  for (int i=1; i<158; i++)
  {
    myGLCD.drawPixel(i,63+(cos(((i*2.27)*3.14)/180)*40));
  }

  myGLCD.setColor(255,255,0);
  myGLCD.print("Tan", 5, 39);
  for (int i=1; i<158; i++)
  {
    myGLCD.drawPixel(i,63+(tan(((i*2.27)*3.14)/180)));
  }

  delay(2000);

  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,14,158,113);
  myGLCD.setColor(0, 0, 255);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.drawLine(79, 14, 79, 113);
  myGLCD.drawLine(1, 63, 158, 63);

 myGLCD.setColor(0, 0, 255);
 myGLCD.drawLine(0, 79, 159, 79);  

// Draw a moving sinewave
  x=1;
  for (int i=1; i<(158*20); i++) 
  {
    x++;
    if (x==159)
      x=1;
    if (i>159)
    {
      if ((x==79)||(buf[x-1]==63))
        myGLCD.setColor(0,0,255);
      else
        myGLCD.setColor(0,0,0);
      myGLCD.drawPixel(x,buf[x-1]);
    }
    myGLCD.setColor(0,255,255);
    y=63+(sin(((i*2.5)*3.14)/180)*(40-(i / 100)));
    myGLCD.drawPixel(x,y);
    buf[x-1]=y;
  }

  delay(2000);
 
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,14,158,113);
  
 myGLCD.setColor(0, 0, 255);
 myGLCD.drawLine(0, 79, 159, 79);  

// Draw some filled rectangles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        myGLCD.setColor(255,0,255);
        break;
      case 2:
        myGLCD.setColor(255,0,0);
        break;
      case 3:
        myGLCD.setColor(0,255,0);
        break;
      case 4:
        myGLCD.setColor(0,0,255);
        break;
      case 5:
        myGLCD.setColor(255,255,0);
        break;
    }
    myGLCD.fillRect(39+(i*10), 23+(i*10), 59+(i*10), 43+(i*10));
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,14,158,113);
  myGLCD.setColor(0, 0, 255);
 myGLCD.drawLine(0, 79, 159, 79);   

// Draw some filled, rounded rectangles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        myGLCD.setColor(255,0,255);
        break;
      case 2:
        myGLCD.setColor(255,0,0);
        break;
      case 3:
        myGLCD.setColor(0,255,0);
        break;
      case 4:
        myGLCD.setColor(0,0,255);
        break;
      case 5:
        myGLCD.setColor(255,255,0);
        break;
    }
    myGLCD.fillRoundRect(99-(i*10), 23+(i*10), 119-(i*10), 43+(i*10));
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,14,158,113);

 myGLCD.setColor(0, 0, 255);
 myGLCD.drawLine(0, 79, 159, 79);  
// Draw some filled circles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        myGLCD.setColor(255,0,255);
        break;
      case 2:
        myGLCD.setColor(255,0,0);
        break;
      case 3:
        myGLCD.setColor(0,255,0);
        break;
      case 4:
        myGLCD.setColor(0,0,255);
        break;
      case 5:
        myGLCD.setColor(255,255,0);
        break;
    }
    myGLCD.fillCircle(49+(i*10),33+(i*10), 15);
  }

  delay(2000);
    
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,14,158,113);
  
 myGLCD.setColor(0, 0, 255);
 myGLCD.drawLine(0, 79, 159, 79);    

// Draw some lines in a pattern
  myGLCD.setColor (255,0,0);
  for (int i=14; i<113; i+=5)
  {
    myGLCD.drawLine(1, i, (i*1.44)-10, 112);
  }
  myGLCD.setColor (255,0,0);
  for (int i=112; i>15; i-=5)
  {
    myGLCD.drawLine(158, i, (i*1.44)-12, 14);
  }
  myGLCD.setColor (0,255,255);
  for (int i=112; i>15; i-=5)
  {
    myGLCD.drawLine(1, i, 172-(i*1.44), 14);
  }
  myGLCD.setColor (0,255,255);
  for (int i=15; i<112; i+=5)
  {
    myGLCD.drawLine(158, i, 171-(i*1.44), 112);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,14,158,113);
  
 myGLCD.setColor(0, 0, 255);
 myGLCD.drawLine(0, 79, 159, 79);    

// Draw some random circles
  for (int i=0; i<100; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=22+random(116);
    y=35+random(57);
    r=random(20);
    myGLCD.drawCircle(x, y, r);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,14,158,113);
  
 myGLCD.setColor(0, 0, 255);
 myGLCD.drawLine(0, 79, 159, 79);    
  

// Draw some random rectangles
  for (int i=0; i<100; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(156);
    y=16+random(95);
    x2=2+random(156);
    y2=16+random(95);
    myGLCD.drawRect(x, y, x2, y2);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,14,158,113);
  
 myGLCD.setColor(0, 0, 255);
 myGLCD.drawLine(0, 79, 159, 79);    

// Draw some random rounded rectangles
  for (int i=0; i<100; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(156);
    y=16+random(95);
    x2=2+random(156);
    y2=16+random(95);
    myGLCD.drawRoundRect(x, y, x2, y2);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,14,158,113);
  
 myGLCD.setColor(0, 0, 255);
 myGLCD.drawLine(0, 79, 159, 79);  
 
  for (int i=0; i<100; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(156);
    y=16+random(95);
    x2=2+random(156);
    y2=16+random(95);
    myGLCD.drawLine(x, y, x2, y2);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,14,158,113);
  
 myGLCD.setColor(0, 0, 255);
 myGLCD.drawLine(0, 79, 159, 79);  
 
  for (int i=0; i<5000; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    myGLCD.drawPixel(2+random(156), 16+random(95));
  }

  delay(2000);

  myGLCD.fillScr(0, 0, 255);
  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRoundRect(10, 17, 149, 72);
  
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.print("That's it!", CENTER, 20);
  myGLCD.print("Restarting in a", CENTER, 45);
  myGLCD.print("few seconds...", CENTER, 57);
  
  myGLCD.setColor(0, 255, 0);
  myGLCD.setBackColor(0, 0, 255);
  myGLCD.print("Runtime: (msecs)", CENTER, 103);
  myGLCD.printNumI(millis(), CENTER, 115);

  delay (5000);   
}

Dan nimm doch mall meine Einstellungen hast ja Jumper Kabel, und vor allem andere, neue Kabel, glaube nicht, das beide Displays sind defekt.
CS 15
RST 2
DC4

UTFT myGLCD ( ST7735S, 15, 2, 4 ); 

MOSI und SCK muss man nicht unbedingt deklarieren.

Vor allem wo deklarierst du was für Schrift soll angezeigt werden?
Das kann man im Setup machen (bei nur einer Schrift besser), oder im der loop
myGLCD.setFont ( SmallFont );

void setup() {
  // Display initialisieren
  myGLCD.InitLCD();
  myGLCD.clrScr();
  myGLCD.setFont ( SmallFont );
}

Du versuchst verstehen was im dem Sketch passiert, deshalb die Änderung in der String Ausgabe.
So habe auch angefangen. :slightly_smiling_face:

Kennst Du das Mega 2560 Pro Board mit 55 x 38 mm?

Ich weiß ist keine Empfehlung, in der Bucht istber für 13€.
Der gezeigter hat großen Nachteil, paßt nicht auf Steckbret, auf Rasterplatine kompliziert zum löten, ok das mit löten ist Erfahrungsache.
Das bei @stefan-007 die Displays nicht funktionieren mit ESP32, Strippen oder Lib fehler.

Ok, war nur so eine Idee.
Ich tippe mal, der Fehler liegt an der fehlenden Definition der Display Größe. Evtl. ist die Library nicht für die Größe des TFT geeignet.

Meine Vermutung:
Du kommst beim ESP32 nicht um eine andere Library (evtl. TFT_eSPI) rum.

Nein, die Lib schaut nach Displaygröße, meiner ist 128 x 160, das gezeigte vom TO ist 128 x 128.

Auch nein, bei mir funktioniert mit ESP32.
Vermutung ER hat andere Version der Lib, meine musste erst endpacken und dann in Lib Ordner verschieben, die ist bei Git falsch verpackt.

Zu dem kann auch das ESP32 Core in die Suppe Spucken , ich nutze die 2.0.17, aber das habe dem TO schon geschrieben.

Das mit der fehlender Schrift(Text) auf dem Display hat sich ja erledigt, sehe Post#12

Bei Aliexpress standen keine Maße dran, bei Reichelt schon. Steckbrett ist für ein Projekt irrelevant, da Pins identisch zum Mega2560. Rudimentäre Erfahrung mit dem Löten setze ich voraus bei so einem Vorhaben.

Ungepflegte alte Bibliothek paßt gut zu alter Hardware, finde ich :wink:

Das schon, nur sollte man dazu ach alte Umgebung haben.

Es ist nicht das erste mall wo die die Bibliotheken spinnen mit neusten ESP32 Core.
Zu Info die aller neuste TFT_eSPI tuts auch mit dem Core 3.0.1 mit höheren nicht probiert.
Gerade Display Bibliotheken zeigen fasch Verhalten mit aller neuste Software.

Ach ja....und warum verwendet der TO ein 80 x 128 ?
Aber egal, du wirst es wissen. ;)

Zeige mall link zu deine Bibliothek den so einen

Konstrukt knan nicht mit Mega 2560 funktionieren, der Mega hat SPI an 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS), wo SS ist nur relevant für 8 oder 16 Bit 5V Displays für Mega zB.

@stefan-007 zeige mal Foto mit Uno + das kleine Display.