GxEPD2_MinimumExample.ino 1.2 KB

12345678910111213141516171819202122232425262728293031
  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. // comment out next line to have no or minimal Adafruit_GFX code
  16. display.setTextColor(GxEPD_BLACK);
  17. display.firstPage();
  18. do
  19. {
  20. display.fillScreen(GxEPD_WHITE);
  21. // comment out next line to have no or minimal Adafruit_GFX code
  22. display.print("Hello World!");
  23. }
  24. while (display.nextPage());
  25. }
  26. void loop() {};