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
2.03k stars 643 forks source link

setLogBuffer should clear logBufferFilled #170

Closed sburlot closed 4 years ago

sburlot commented 6 years ago

Perhaps I dont really get it, but I want to display text on the screen, and clear it before each loop.

My loop looks like this:

    display.setLogBuffer(5, 30);
    display.clear();
    display.print("count = ");
    display.println(count);
    display.println("Hello");
    display.drawLogBuffer(0, 0);
    display.display();
    count = count+1;
    delay(1000);

Whatever I do, the display will scroll.

Modifying the file OLEDDisplay.cpp, in setLogBuffer

    this->logBufferSize     = size;   // Total number of characters the buffer can hold
    this->logBuffer         = (char *) malloc(size * sizeof(uint8_t));
    this->logBufferFilled   = 0; // <-- Add this line

And now it does what I need it to. Did I miss something?

stale[bot] commented 5 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.

stale[bot] commented 5 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.