Open hulkco opened 6 years ago
I'm not sure what's causing this, but there's a chance that it's fixed: There was a race condition where some data/commands were ignored if the EPD panel was busy during an update. The ESP32 is fast enough to trigger this issue.
This has been fixed on branch feature/compression but not merged into master. (Feel free to try that branch. I need to test this a bit, before doing a pull request.)
I'll update this issue when it's merged into master.
I'm trying, using the library with the ESP32 DevKit, using the sample program, everything is fine, except the images, which tend to move aside, leaving a ghost trail. `#include
include
include "FancyEPD.h"
include "FancyEPD_Demo_images.h"
define DELAY_BETWEEN_IMAGES_MS (6 * 1000)
define DO_ROTATION (true)
// initialize epaper with pin numbers for cs, dc, rs, bs, d0, d1 for software SPI //EPD215 epaper( 17, 16, 15, 14, 13, 11 ); // Pins for project: github.com/pdp7/kicad-teensy-epaper //FancyEPD epd(k_epd_model_E2215CS062, 17, 16, 14, 15, 13, 11); // software SPI //FancyEPD epd(k_epd_model_E2215CS062, 17, 16, 14, 15); // hardware SPI
//ESP12 Pinout //FancyEPD epd(k_epd_model_E2215CS062, 15, 2, 5, 4, 14, 13);
//ESP32 Pinout // initialize epaper with pin numbers for cs, dc, rs, bs, d0, d1 for software SPI FancyEPD epd(k_epd_model_E2215CS062, 18, 19, 21, 22,23,5);
void setup() { bool success = epd.init();
}
void loop() { /* if (DO_ROTATION) epd.setRotation(0); drawCircles(); drawLabel("Update:\n builtin_refresh"); epd.setBorderColor(0x00); // white epd.updateScreen(k_update_builtin_refresh); delay(DELAY_BETWEEN_IMAGES_MS);
/ //Arduino_ESP32 if (DO_ROTATION) epd.setRotation(3); epd.setBorderColor(0xff); // black epd.updateScreenWithImage( Arduino_ESP32, k_image_4bit_monochrome, k_update_no_blink ); delay(DELAY_BETWEEN_IMAGES_MS); / // Angel if (DO_ROTATION) epd.setRotation(0); epd.setBorderColor(0xff); // black epd.updateScreenWithImage(angel_4bit, k_image_4bit_monochrome, k_update_quick_refresh); delay(DELAY_BETWEEN_IMAGES_MS);
*/
}
void drawCircles() { epd.clearBuffer(); for (uint8_t i = 0; i < 5; i++) { uint8_t radius = random(1, 80); epd.drawCircle(random(epd.width()), random(epd.height()), radius, 0xff); } }
void drawTriangles() { epd.clearBuffer();
}
void drawLabel(String str) { // Background box const uint8_t box_height = 20; epd.fillRect(0, 0, epd.width(), box_height, 0x0); epd.drawFastHLine(0, box_height, epd.width(), 0xff);
}
The only thing I modified was to add the pinout for the ESP32:
//ESP32 Pinout // initialize epaper with pin numbers for cs, dc, rs, bs, d0(SCK), d1(MOSI) for software SPI FancyEPD epd(k_epd_model_E2215CS062, 17, 16, 5, 19, 18, 23);`