Closed 120c0 closed 9 months ago
Do you expect the screen to scroll? After a few lines, you keep overwriting the same text at the bottom.
When I change the screen size, to 128x64 it starts showing the text 2 times below.
I did some tests and it seems to be when rendering the pages, no matter how much I readjust the height, it gets buggy on the 4th line down.
#include <Tiny4kOLED.h>
void setup() {
oled.begin(sizeof(tiny4koled_init_128x64br), tiny4koled_init_128x64br);
oled.setFont(FONT6X8);
oled.clear();
updateDisplay();
oled.switchRenderFrame();
oled.on();
}
void loop() {
updateDisplay();
oled.switchFrame();
oled.clear();
}
void updateDisplay() {
oled.clear();
oled.setCursor(0, 0);
oled.print(F("millis: "));
oled.println(millis());
oled.println(F("/root $ "));
}
Use the begin method that takes with and height too.
Like that?
oled.begin(128, 64, sizeof(tiny4koled_init_128x64br), tiny4koled_init_128x64br);
I already tried that, nothing changes.
Yes, and when using the 128x64 size display, you don't have 2 frames to use, so you need to remove the oled.switchRenderFrame(); and oled.switchFrame(); With the 128x32 display you can write to memory that is 'offscreen', then switch to it. With the 128x64 display you cannot, as all its memory is visible. The flickering is due to calling oled.clear(). An alternative strategy is to just update portions of the screen that change - for this example, just writing the millis.
Thank you!
Look at
When i upload this code to MH Attiny88, show but with flicking... Only when i change default size and font size....