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
}
However, this TFT display flickers everytime I call TFT_display function. I believe the reason for that is because when i use tft.fillscreen it takes a while to print all the values on the screen?. Im not sure why I am not able to see any flickering on my SSD1306 OLED display.
Could someone suggest me a way to fix this problem since its very annoying and not convenient to look at such delay that is flickering every time a value is being changed.