U8G2 runs very slowly
Posted: Tue Mar 09, 2021 5:26 pm
So, the good news what the driver problem has been solved but, as is often the way, things move forward then hold!
I'm running a 128x64 OLED with SPI
For testing, I'm drawing a 10 pixel circle and moving on one pixel every loop - I started with a delay but have now removed it:
The problem I'm having now is that the draw speed is very, very slow - one circle a second running on an ESP32 with Freertos. Its so slow you can see it writing the circle!
Your thoughts/ideas on why this is happening would be very welcome. Runs a dream on Arduino (SPI)
I'm running a 128x64 OLED with SPI
For testing, I'm drawing a 10 pixel circle and moving on one pixel every loop - I started with a delay but have now removed it:
The problem I'm having now is that the draw speed is very, very slow - one circle a second running on an ESP32 with Freertos. Its so slow you can see it writing the circle!
Code: Select all
u8g2_t u8g2;
u8g2_Setup_ssd1306_128x64_noname_f(
&u8g2,
U8G2_R0,
u8g2_esp32_spi_byte_cb,
u8g2_esp32_gpio_and_delay_cb);
u8g2_InitDisplay(&u8g2); // send init sequence to the display, display is in sleep mode after this,
u8g2_SetPowerSave(&u8g2, 0); // wake up display
int intXPos = 0;
u8g2_ClearBuffer(&u8g2);
u8g2_DrawCircle(&u8g2, 32,intXPos, 10,U8G2_DRAW_ALL);
u8g2_SetFont(&u8g2, u8g2_font_ncenB14_tr);
u8g2_DrawStr(&u8g2, 0,15,"Hello Colin!");
while(true){
u8g2_ClearBuffer(&u8g2);
u8g2_DrawCircle(&u8g2, intXPos,32, 10,U8G2_DRAW_ALL);
u8g2_SendBuffer(&u8g2);
intXPos +=1;
if (intXPos>100) intXPos = 0;
//vTaskDelay(10/ portTICK_PERIOD_MS);
}