mirror of
https://github.com/nopnop2002/esp-idf-ssd1306.git
synced 2024-10-03 18:18:47 -04:00
Compare commits
2 Commits
8796a47487
...
8b00a7e705
Author | SHA1 | Date | |
---|---|---|---|
|
8b00a7e705 | ||
|
c40aa646aa |
@ -196,13 +196,13 @@ void app_main(void)
|
||||
}
|
||||
|
||||
// Allocate memory for background frame
|
||||
uint8_t *buffer = (uint8_t *)malloc(1024*4);
|
||||
if (buffer == NULL) {
|
||||
uint8_t *background = (uint8_t *)malloc(1024*4);
|
||||
if (background == NULL) {
|
||||
ESP_LOGE(TAG, "malloc failed");
|
||||
while(1) { vTaskDelay(1); }
|
||||
}
|
||||
|
||||
// Allocate memory for background frame
|
||||
// Allocate memory for balloon frame
|
||||
uint8_t *balloon = (uint8_t *)malloc(1024);
|
||||
if (balloon == NULL) {
|
||||
ESP_LOGE(TAG, "malloc failed");
|
||||
@ -213,22 +213,22 @@ void app_main(void)
|
||||
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
ssd1306_bitmaps(&dev, 0, 0, cloud11, 64, 32, true);
|
||||
ssd1306_get_buffer(&dev, &buffer[1024*0]);
|
||||
ssd1306_get_buffer(&dev, &background[1024*0]);
|
||||
vTaskDelay(10);
|
||||
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
ssd1306_bitmaps(&dev, 0, 0, cloud12, 64, 32, true);
|
||||
ssd1306_get_buffer(&dev, &buffer[1024*1]);
|
||||
ssd1306_get_buffer(&dev, &background[1024*1]);
|
||||
vTaskDelay(10);
|
||||
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
ssd1306_bitmaps(&dev, 0, 0, cloud13, 64, 32, true);
|
||||
ssd1306_get_buffer(&dev, &buffer[1024*2]);
|
||||
ssd1306_get_buffer(&dev, &background[1024*2]);
|
||||
vTaskDelay(10);
|
||||
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
ssd1306_bitmaps(&dev, 0, 0, cloud14, 64, 32, true);
|
||||
ssd1306_get_buffer(&dev, &buffer[1024*3]);
|
||||
ssd1306_get_buffer(&dev, &background[1024*3]);
|
||||
vTaskDelay(10);
|
||||
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
@ -267,14 +267,14 @@ void app_main(void)
|
||||
if (page1 < 4) {
|
||||
for (int seg=0;seg<64;seg++) {
|
||||
if (seg+segmentOffset1 > 0 && seg+segmentOffset1 < 128)
|
||||
wk[seg+segmentOffset1] = buffer[page1*128+seg+frameOffset1];
|
||||
wk[seg+segmentOffset1] = background[page1*128+seg+frameOffset1];
|
||||
}
|
||||
}
|
||||
|
||||
if (page2 < 4) {
|
||||
for (int seg=0;seg<64;seg++) {
|
||||
if (seg+segmentOffset2 > 0 && seg+segmentOffset2 < 128)
|
||||
wk[seg+segmentOffset2] = buffer[page2*128+seg+frameOffset2];
|
||||
wk[seg+segmentOffset2] = background[page2*128+seg+frameOffset2];
|
||||
}
|
||||
}
|
||||
ssd1306_set_buffer(&dev, wk);
|
||||
|
@ -14,8 +14,6 @@ __Wire cables should be as short as possible.__
|
||||
I used a 10 cm wire cable.
|
||||
However, it is sometimes affected by noise.
|
||||
|
||||
__Flip upside down cannot be enabled.__
|
||||
|
||||
__This demo does not support 128x32 panels.__
|
||||
|
||||
The SPI interface operates faster than the I2C interface.
|
||||
|
@ -631,12 +631,10 @@ void app_main(void)
|
||||
spi_master_init(&dev, CONFIG_MOSI_GPIO, CONFIG_SCLK_GPIO, CONFIG_CS_GPIO, CONFIG_DC_GPIO, CONFIG_RESET_GPIO);
|
||||
#endif // CONFIG_SPI_INTERFACE
|
||||
|
||||
#if 0
|
||||
#if CONFIG_FLIP
|
||||
dev._flip = true;
|
||||
ESP_LOGW(TAG, "Flip upside down");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_SSD1306_128x64
|
||||
ESP_LOGI(TAG, "Panel is 128x64");
|
||||
|
Loading…
Reference in New Issue
Block a user