mirror of
https://github.com/nopnop2002/esp-idf-ssd1306.git
synced 2024-10-03 18:18:47 -04:00
Adjusted the latency between frames.
This commit is contained in:
parent
d35f322779
commit
8dd2f99953
@ -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.
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user