TFT ST7735 flickering on ESP32

Hey. I have used an OLED 1.3" display for my project and did not have any problems.

for my OLED, i had a function:

void OLED_display(int number1){

    int address=0;



    display.setTextSize(4);

    display.clearDisplay();

    display.setCursor(0,0);                

    display.println(EEPROM.readUShort(address));

    //Serial.print("OLED display quantity = ");

    //Serial.println(EEPROM.readUShort(address));

    address += sizeof(unsigned short); 

    //display.display();

    display.setCursor(0,32);                 

    display.println(number1);        // number2 means number to_pick

    display.setTextSize(1);

    display.setCursor(64,32);

    display.println(current_status);       

    display.setCursor(64,40);

    display.println(DEVICE_ID);       

    display.setCursor(64,48); 

    display.println(EEPROM.get(address,eeprom_serial));      //print SERIAL id

    address += 10;

    display.setCursor(64,56); 

    display.println(encoder.displaycounter);      //print SERIAL id

    display.display();

}

Being called every 1second to update all the values that I need on my display.

I have decided to switch to bigger display ST7735 and wrote an identical function for it:

void TFT_setup(){

  tft.initR(INITR_BLACKTAB);

  tft.setRotation(1);

  pinMode(TFT_BACKLIGHT, OUTPUT);

  //tft.invertDisplay(false);

  digitalWrite(TFT_BACKLIGHT, HIGH); // Backlight on

  tft.fillScreen(ST77XX_BLACK);

  tft.setTextColor(ST77XX_GREEN);



}





void TFT_display(int number1){

    int address=0;

    tft.setTextSize(3);

    tft.fillScreen(ST77XX_BLACK);

    tft.setCursor(0, 0);   

    tft.print(EEPROM.readUShort(address));            

    address += sizeof(unsigned short); 

    tft.setCursor(0,32);                 

    tft.print(number1);        // number2 means number to_pick

    tft.setTextSize(1);

    tft.setCursor(64,32);

    tft.print(current_status);       

    tft.setCursor(64,40);

    tft.print(DEVICE_ID);       

    tft.setCursor(64,48); 

    tft.print(EEPROM.get(address,eeprom_serial));      //print SERIAL id

    address += 10;

    tft.setCursor(64,56); 

    tft.print(encoder.displaycounter);      //print SERIAL id



}

I have decided to switch to bigger display

That is your problem. The smaller size of the first display masked the fact that you used very inefficient code.

You should not wipe out the screen and write to it again, you should only wipe and update the portion of the screen that has changed since your last update.