ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
2k stars 638 forks source link

Overwrite one line as string #244

Closed davidwowa closed 4 years ago

davidwowa commented 5 years ago

In my display I have seven lines with different value, there are refresh in different time. I must every time run display.clear(), but I will refresh only one line from seven, it is possible? thx

beast099 commented 5 years ago

you can utilize the fillRect function to essentially clear a single line.

if your using the ArialMT_Plain_10 font, which is 10 pixels in height then something like:

display.setColor(BLACK);
display.fillRect(0, 0, 128, 10);
display.display();
display.setColor(WHITE);

will "clear" the first line

display.fillRect(0,10,128,10);

will "clear" the second line and so on.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.