Adjusted the latency between frames.

This commit is contained in:
nopnop2002 2024-09-12 13:07:06 +09:00
parent d35f322779
commit 8dd2f99953
2 changed files with 15 additions and 16 deletions

View File

@ -7,9 +7,12 @@
I borrowed the BIT MAP data from [here](https://www.mischianti.org/2021/07/14/ssd1306-oled-display-draw-images-splash-and-animations-2/).
__Wire cables should be as short as possible.__
__Flip upside down cannot be enabled.__
I used a 10 cm wire cable.
However, it is sometimes affected by noise.
__Flip upside down cannot be enabled.__
The SPI interface operates faster than the I2C interface.
For SPI interfaces, there has a latency period between frames.
By making this smaller, you can display it even faster.

View File

@ -744,31 +744,27 @@ void app_main(void)
int count = 9;
uint8_t segs[128];
while(1) {
#if 0
TickType_t startTick = xTaskGetTickCount();
// 1Ticks required
#endif
for (int page=0;page<8;page++) {
for (int seg=0;seg<128;seg++) {
segs[seg] = ssd1306_rotate_byte(monkeyAnimation[count][seg*8+page]);
}
ssd1306_display_image(&dev, page, 0, segs, 128);
}
#if 0
int index = 0;
// 26Ticks required
for (int seg=0;seg<128;seg++) {
for (int page=0;page<8;page++) {
uint8_t wk[1];
wk[0] = monkeyAnimation[count][index++];
wk[0] = ssd1306_rotate_byte(wk[0]);
ssd1306_display_image(&dev, page, seg, wk, 1);
}
}
#endif
// 1Ticks required
TickType_t endTick = xTaskGetTickCount();
ESP_LOGD(TAG, "diffTick=%"PRIu32, endTick - startTick);
#endif
count--;
if (count<0) count = 9;
vTaskDelay(4);
#if CONFIG_SPI_INTERFACE
// SPI is too fast, so wait a little.
vTaskDelay(3);
#endif
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
}