added PAGE_SCROLL_DOWN/PAGE_SCROLL_UP function

This commit is contained in:
nopnop2002 2024-09-12 12:58:19 +09:00
parent 9209b3db93
commit 5caf45b5b5
2 changed files with 56 additions and 2 deletions

View File

@ -2,3 +2,44 @@
![RoteteDemo](https://user-images.githubusercontent.com/6020549/165236460-e1fd757c-dcff-4601-bce1-b533599b5fc5.JPG)
A 128x32 panel has 4 pages of internal memory, and a 128x64 panel has 8 pages of internal memory.
PAGE_SCROLL_DOWN/PAGE_SCROLL_UP is page-by-page scrolling and works fast.
```
+--------+
| Page 1 |
+--------+
| Page 2 |
+--------+
| Page 3 |
+--------+
| Page 4 |
+--------+
| Page 5 |
+--------+
| Page 6 |
+--------+
| Page 7 |
+--------+
| Page 8 |
+--------+
+--------+
| Page 2 |
+--------+
| Page 3 |
+--------+
| Page 4 |
+--------+
| Page 5 |
+--------+
| Page 6 |
+--------+
| Page 7 |
+--------+
| Page 8 |
+--------+
| Page 1 |
+--------+
```

View File

@ -107,14 +107,14 @@ void app_main(void)
ESP_LOGD(TAG, "height=%d", height);
for(int i=0;i<height;i++) {
ssd1306_wrap_arround(&dev, SCROLL_UP, 0, 31, 0);
ssd1306_wrap_arround(&dev, SCROLL_UP, 96, 127, 0);
ssd1306_wrap_arround(&dev, SCROLL_DOWN, 96, 127, 0);
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
ESP_LOGD(TAG, "height=%d", height);
for(int i=0;i<height;i++) {
ssd1306_wrap_arround(&dev, SCROLL_DOWN, 0, 31, 0);
ssd1306_wrap_arround(&dev, SCROLL_DOWN, 96, 127, 0);
ssd1306_wrap_arround(&dev, SCROLL_UP, 96, 127, 0);
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
@ -129,5 +129,18 @@ void app_main(void)
ssd1306_wrap_arround(&dev, SCROLL_UP, 0, 127, 0);
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
// PAGE_SCROLL is only a Byte operation, so it's very fast
for(int i=0;i<=pages;i++) {
ssd1306_wrap_arround(&dev, PAGE_SCROLL_DOWN, 0, 0, 0);
vTaskDelay(2);
}
vTaskDelay(1000 / portTICK_PERIOD_MS);
for(int i=0;i<=pages;i++) {
ssd1306_wrap_arround(&dev, PAGE_SCROLL_UP, 0, 0, 0);
vTaskDelay(2);
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
} // end while
}