mirror of
https://github.com/nopnop2002/esp-idf-ssd1306.git
synced 2024-10-03 18:18:47 -04:00
Changed from RotateDemo to WarpAroundDemo
This commit is contained in:
parent
51314fe2b3
commit
d95e58b519
@ -193,7 +193,7 @@ void app_main(void)
|
|||||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
for(int i=0;i<128;i++) {
|
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);
|
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ void app_main(void)
|
|||||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
for(int i=0;i<64;i++) {
|
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);
|
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# RotateDemo for SSD1306
|
# WrapAroundDemo for SSD1306
|
||||||
|
|
||||||
![RoteteDemo](https://user-images.githubusercontent.com/6020549/165236460-e1fd757c-dcff-4601-bce1-b533599b5fc5.JPG)
|
![RoteteDemo](https://user-images.githubusercontent.com/6020549/165236460-e1fd757c-dcff-4601-bce1-b533599b5fc5.JPG)
|
||||||
|
|
@ -88,17 +88,17 @@ void app_main(void)
|
|||||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||||
while(1) {
|
while(1) {
|
||||||
for(int i=0;i<128;i++) {
|
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) {
|
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);
|
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
for(int i=0;i<128;i++) {
|
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) {
|
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);
|
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||||
@ -106,27 +106,27 @@ void app_main(void)
|
|||||||
int height = ssd1306_get_height(&dev);
|
int height = ssd1306_get_height(&dev);
|
||||||
ESP_LOGD(TAG, "height=%d", height);
|
ESP_LOGD(TAG, "height=%d", height);
|
||||||
for(int i=0;i<height;i++) {
|
for(int i=0;i<height;i++) {
|
||||||
ssd1306_rotate(&dev, SCROLL_UP, 0, 31, 0);
|
ssd1306_wrap_arround(&dev, SCROLL_UP, 0, 31, 0);
|
||||||
ssd1306_rotate(&dev, SCROLL_UP, 96, 127, 0);
|
ssd1306_wrap_arround(&dev, SCROLL_UP, 96, 127, 0);
|
||||||
}
|
}
|
||||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
ESP_LOGD(TAG, "height=%d", height);
|
ESP_LOGD(TAG, "height=%d", height);
|
||||||
for(int i=0;i<height;i++) {
|
for(int i=0;i<height;i++) {
|
||||||
ssd1306_rotate(&dev, SCROLL_DOWN, 0, 31, 0);
|
ssd1306_wrap_arround(&dev, SCROLL_DOWN, 0, 31, 0);
|
||||||
ssd1306_rotate(&dev, SCROLL_DOWN, 96, 127, 0);
|
ssd1306_wrap_arround(&dev, SCROLL_DOWN, 96, 127, 0);
|
||||||
}
|
}
|
||||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
for(int i=0;i<128;i++) {
|
for(int i=0;i<128;i++) {
|
||||||
ssd1306_rotate(&dev, SCROLL_RIGHT, 0, pages, 0);
|
ssd1306_wrap_arround(&dev, SCROLL_RIGHT, 0, pages, 0);
|
||||||
ssd1306_rotate(&dev, SCROLL_DOWN, 0, 127, 0);
|
ssd1306_wrap_arround(&dev, SCROLL_DOWN, 0, 127, 0);
|
||||||
}
|
}
|
||||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
for(int i=0;i<128;i++) {
|
for(int i=0;i<128;i++) {
|
||||||
ssd1306_rotate(&dev, SCROLL_LEFT, 0, pages, 0);
|
ssd1306_wrap_arround(&dev, SCROLL_LEFT, 0, pages, 0);
|
||||||
ssd1306_rotate(&dev, SCROLL_UP, 0, 127, 0);
|
ssd1306_wrap_arround(&dev, SCROLL_UP, 0, 127, 0);
|
||||||
}
|
}
|
||||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||||
} // end while
|
} // end while
|
@ -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) {
|
if (scroll == SCROLL_RIGHT) {
|
||||||
int _start = start; // 0 to 7
|
int _start = start; // 0 to 7
|
||||||
|
@ -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_text(SSD1306_t * dev, char * text, int text_len, bool invert);
|
||||||
void ssd1306_scroll_clear(SSD1306_t * dev);
|
void ssd1306_scroll_clear(SSD1306_t * dev);
|
||||||
void ssd1306_hardware_scroll(SSD1306_t * dev, ssd1306_scroll_type_t scroll);
|
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_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_invert(uint8_t *buf, size_t blen);
|
||||||
void ssd1306_flip(uint8_t *buf, size_t blen);
|
void ssd1306_flip(uint8_t *buf, size_t blen);
|
||||||
|
Loading…
Reference in New Issue
Block a user