GxEPD2_MinimumExample.ino 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // GxEPD2_MinimumExample.ino by Jean-Marc Zingg
  2. // purpose is e.g. to determine minimum code and ram use by this library
  3. // see GxEPD2_wiring_examples.h of GxEPD2_Example for wiring suggestions and examples
  4. // if you use a different wiring, you need to adapt the constructor parameters!
  5. // uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX, to use less code and ram
  6. //#include <GFX.h>
  7. #include <GxEPD2_BW.h> // including both doesn't use more code or ram
  8. #include <GxEPD2_3C.h> // including both doesn't use more code or ram
  9. #include <GxEPD2_7C.h> // same for all three
  10. // select the display class and display driver class in the following file (new style):
  11. #include "GxEPD2_display_selection_new_style.h"
  12. // alternately you can copy the constructor from GxEPD2_display_selection.h or GxEPD2_display_selection_added.h of GxEPD2_Example to here
  13. // e.g. for Wemos D1 mini:
  14. //GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154D67
  15. void setup()
  16. {
  17. //display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02
  18. display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse
  19. // comment out next line to have no or minimal Adafruit_GFX code
  20. display.setTextColor(GxEPD_BLACK);
  21. display.firstPage();
  22. do
  23. {
  24. display.fillScreen(GxEPD_WHITE);
  25. // comment out next line to have no or minimal Adafruit_GFX code
  26. display.print("Hello World!");
  27. }
  28. while (display.nextPage());
  29. }
  30. void loop() {};