GxEPD2_MinimumExample.ino 1.1 KB

1234567891011121314151617181920212223242526272829
  1. // GxEPD2_MinimumExample.ino by Jean-Marc Zingg
  2. // uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX
  3. #include <GFX.h>
  4. #define ENABLE_GxEPD2_GFX 0
  5. #include <GxEPD2_BW.h> // including both doesn't hurt
  6. #include <GxEPD2_3C.h> // including both doesn't hurt
  7. // copy constructor for your e-paper from GxEPD2_Example.ino, and for AVR needed #defines
  8. #define MAX_DISPLAY_BUFFER_SIZE 800 //
  9. #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
  10. //GxEPD2_BW<GxEPD2_154, MAX_HEIGHT(GxEPD2_154)> display(GxEPD2_154(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEP015OC1 no longer available
  11. GxEPD2_BW<GxEPD2_154_D67, MAX_HEIGHT(GxEPD2_154_D67)> display(GxEPD2_154_D67(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154D67
  12. void setup()
  13. {
  14. display.init();
  15. display.firstPage();
  16. do
  17. {
  18. display.fillScreen(GxEPD_WHITE);
  19. // comment out next line to have no or minimal Adafruit_GFX code
  20. display.print("Hello World!");
  21. }
  22. while (display.nextPage());
  23. }
  24. void loop() {};