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
1.98k stars 638 forks source link

No way to clear logBuffer #396

Closed ropg closed 3 months ago

ropg commented 4 months ago

It just occurred to me that once printing has started, there is no way to print on lines higher than where the last print happened because there is no way for the user to clear logBuffer. Can't put that in clear() without restructuring as we use it internally before we print logBuffer. Also that would not show effect until the next print call, which kind of puts the user's head in a loop if she expects a Print-class device.

I propose a function cls(), which clears the display (immediately, so clear() and display()) as well as empties the logBuffer. Naturally this needs documentation and the difference between clear() and cls() would need to be explained. It'll always stay a bit confusing, but there's just too much code that uses clear() as is.

Didn't want to make this a PR just yet because maybe there's other/better ideas. If not I am happy to create the PR.

ropg commented 3 months ago

I had some time and went ahead and created a bit of documentation for the Arduino Print function and how it relates to the rest of the functionality in the README and added this cls() function in PR #397

Hope you like it. With this and the other changes in #395, print is now completely functional.