Changed from RotateDemo to WarpAroundDemo

This commit is contained in:
nopnop2002 2022-04-26 20:11:08 +09:00
parent 51314fe2b3
commit d95e58b519
8 changed files with 17 additions and 17 deletions

View File

@ -193,7 +193,7 @@ void app_main(void)
vTaskDelay(3000 / portTICK_PERIOD_MS);
for(int i=0;i<128;i++) {
ssd1306_rotate(&dev, SCROLL_RIGHT, 2, 3, 0);
ssd1306_wrap_arround(&dev, SCROLL_RIGHT, 2, 3, 0);
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
@ -203,7 +203,7 @@ void app_main(void)
vTaskDelay(2000 / portTICK_PERIOD_MS);
for(int i=0;i<64;i++) {
ssd1306_rotate(&dev, SCROLL_UP, 0, 127, 0);
ssd1306_wrap_arround(&dev, SCROLL_UP, 0, 127, 0);
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
#endif

View File

@ -1,4 +1,4 @@
# RotateDemo for SSD1306
# WrapAroundDemo for SSD1306
![RoteteDemo](https://user-images.githubusercontent.com/6020549/165236460-e1fd757c-dcff-4601-bce1-b533599b5fc5.JPG)

View File

@ -88,17 +88,17 @@ void app_main(void)
vTaskDelay(3000 / portTICK_PERIOD_MS);
while(1) {
for(int i=0;i<128;i++) {
ssd1306_rotate(&dev, SCROLL_RIGHT, 1, 2, 0);
ssd1306_wrap_arround(&dev, SCROLL_RIGHT, 1, 2, 0);
if (pages == 7) {
ssd1306_rotate(&dev, SCROLL_RIGHT, 5, 6, 0);
ssd1306_wrap_arround(&dev, SCROLL_RIGHT, 5, 6, 0);
}
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
for(int i=0;i<128;i++) {
ssd1306_rotate(&dev, SCROLL_LEFT, 1, 2, 0);
ssd1306_wrap_arround(&dev, SCROLL_LEFT, 1, 2, 0);
if (pages == 7) {
ssd1306_rotate(&dev, SCROLL_LEFT, 5, 6, 0);
ssd1306_wrap_arround(&dev, SCROLL_LEFT, 5, 6, 0);
}
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
@ -106,27 +106,27 @@ void app_main(void)
int height = ssd1306_get_height(&dev);
ESP_LOGD(TAG, "height=%d", height);
for(int i=0;i<height;i++) {
ssd1306_rotate(&dev, SCROLL_UP, 0, 31, 0);
ssd1306_rotate(&dev, SCROLL_UP, 96, 127, 0);
ssd1306_wrap_arround(&dev, SCROLL_UP, 0, 31, 0);
ssd1306_wrap_arround(&dev, SCROLL_UP, 96, 127, 0);
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
ESP_LOGD(TAG, "height=%d", height);
for(int i=0;i<height;i++) {
ssd1306_rotate(&dev, SCROLL_DOWN, 0, 31, 0);
ssd1306_rotate(&dev, SCROLL_DOWN, 96, 127, 0);
ssd1306_wrap_arround(&dev, SCROLL_DOWN, 0, 31, 0);
ssd1306_wrap_arround(&dev, SCROLL_DOWN, 96, 127, 0);
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
for(int i=0;i<128;i++) {
ssd1306_rotate(&dev, SCROLL_RIGHT, 0, pages, 0);
ssd1306_rotate(&dev, SCROLL_DOWN, 0, 127, 0);
ssd1306_wrap_arround(&dev, SCROLL_RIGHT, 0, pages, 0);
ssd1306_wrap_arround(&dev, SCROLL_DOWN, 0, 127, 0);
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
for(int i=0;i<128;i++) {
ssd1306_rotate(&dev, SCROLL_LEFT, 0, pages, 0);
ssd1306_rotate(&dev, SCROLL_UP, 0, 127, 0);
ssd1306_wrap_arround(&dev, SCROLL_LEFT, 0, pages, 0);
ssd1306_wrap_arround(&dev, SCROLL_UP, 0, 127, 0);
}
vTaskDelay(2000 / portTICK_PERIOD_MS);
} // end while

View File

@ -243,7 +243,7 @@ void ssd1306_hardware_scroll(SSD1306_t * dev, ssd1306_scroll_type_t scroll)
}
}
void ssd1306_rotate(SSD1306_t * dev, ssd1306_scroll_type_t scroll, int start, int end, uint8_t delay)
void ssd1306_wrap_arround(SSD1306_t * dev, ssd1306_scroll_type_t scroll, int start, int end, uint8_t delay)
{
if (scroll == SCROLL_RIGHT) {
int _start = start; // 0 to 7

View File

@ -115,7 +115,7 @@ void ssd1306_software_scroll(SSD1306_t * dev, int start, int end);
void ssd1306_scroll_text(SSD1306_t * dev, char * text, int text_len, bool invert);
void ssd1306_scroll_clear(SSD1306_t * dev);
void ssd1306_hardware_scroll(SSD1306_t * dev, ssd1306_scroll_type_t scroll);
void ssd1306_rotate(SSD1306_t * dev, ssd1306_scroll_type_t scroll, int start, int end, uint8_t delay);
void ssd1306_wrap_arround(SSD1306_t * dev, ssd1306_scroll_type_t scroll, int start, int end, uint8_t delay);
void ssd1306_bitmaps(SSD1306_t * dev, int xpos, int ypos, uint8_t * bitmap, int width, int height, bool invert);
void ssd1306_invert(uint8_t *buf, size_t blen);
void ssd1306_flip(uint8_t *buf, size_t blen);