Hello there; I designed a simple project. I measure temperature with NTC thermistor and display it on OLED. I share the OLED link which I use in this project OLED Display
There is both temperature information and degree symbol on the OLED screen. I don't want to use the clearDisplay() command. Because the screen is flashing. Therefore, I use setTextColor(WHITE, BLACK) command. This solution worked and the screen is not flashing. But this solution doesn't work when I change the font. The display does not flash, but overwrites the previous value when the temperature value changes. Is there any other way I can solve this?
I created a font suitable for the AdafruitGFX library from the site I shared the link of and used it. Font GFX
In short, when I use the standard font of the Adafruit1306 library, I can solve the problem, but when I change the font, my solution does not work.
TRANS_OLED.setTextSize(5);
TRANS_OLED.setTextColor(WHITE);
TRANS_OLED.setCursor(15, 15);
TRANS_OLED.print(tempCelsiusDecimal);
TRANS_OLED.display();
TRANS_OLED.setTextSize(1);
TRANS_OLED.setTextColor(WHITE);
TRANS_OLED.setCursor(80, 10);
TRANS_OLED.print("o");
TRANS_OLED.display();
TRANS_OLED.setTextSize(5);
TRANS_OLED.setCursor(90, 15);
TRANS_OLED.print("C");
TRANS_OLED.display();
TRANS_OLED.setTextSize(5);
TRANS_OLED.setTextColor(WHITE, BLACK);
TRANS_OLED.setCursor(15, 15);
TRANS_OLED.print(tempCelsiusDecimal);
TRANS_OLED.display();
The code I shared above works fine with the default font.
TRANS_OLED.setFont(&DSEG7_Classic_Mini_Bold_40);
TRANS_OLED.setTextSize(0);
TRANS_OLED.setTextColor(WHITE);
TRANS_OLED.setCursor(30, 50);
TRANS_OLED.print(tempCelsiusDecimal);
TRANS_OLED.display();
TRANS_OLED.setFont(&Dialog_plain_12);
TRANS_OLED.setTextSize(0);
TRANS_OLED.setTextColor(WHITE);
TRANS_OLED.setCursor(100, 15);
TRANS_OLED.print("o");
TRANS_OLED.display();
TRANS_OLED.clearDisplay();
The code above is that I changed the font and it doesn't work properly. It works fine with the clearDisplay() command, but the degree symbol is blinking. As I said above, when I use the setTextColor(WHITE, BLACK) command, the new temperature value overwrites the old temperature value.
Can you help me to overcome this problem? Thank you in advance for your support.