GxEPD2_Example.ino 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052
  1. // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare.
  2. // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines!
  3. //
  4. // Display Library based on Demo Example from Good Display: https://www.good-display.com/companyfile/32/
  5. //
  6. // Author: Jean-Marc Zingg
  7. //
  8. // Version: see library.properties
  9. //
  10. // Library: https://github.com/ZinggJM/GxEPD2
  11. // Supporting Arduino Forum Topics (closed, read only):
  12. // Good Display ePaper for Arduino: https://forum.arduino.cc/t/good-display-epaper-for-arduino/419657
  13. // Waveshare e-paper displays with SPI: https://forum.arduino.cc/t/waveshare-e-paper-displays-with-spi/467865
  14. //
  15. // Add new topics in https://forum.arduino.cc/c/using-arduino/displays/23 for new questions and issues
  16. // see GxEPD2_wiring_examples.h for wiring suggestions and examples
  17. // NOTE for use with Waveshare ESP32 Driver Board:
  18. // **** also need to select the constructor with the parameters for this board in GxEPD2_display_selection_new_style.h ****
  19. //
  20. // The Wavehare ESP32 Driver Board uses uncommon SPI pins for the FPC connector. It uses HSPI pins, but SCK and MOSI are swapped.
  21. // To use HW SPI with the ESP32 Driver Board, HW SPI pins need be re-mapped in any case. Can be done using either HSPI or VSPI.
  22. // Other SPI clients can either be connected to the same SPI bus as the e-paper, or to the other HW SPI bus, or through SW SPI.
  23. // The logical configuration would be to use the e-paper connection on HSPI with re-mapped pins, and use VSPI for other SPI clients.
  24. // VSPI with standard VSPI pins is used by the global SPI instance of the Arduino IDE ESP32 package.
  25. // uncomment next line to use HSPI for EPD (and e.g VSPI for SD), e.g. with Waveshare ESP32 Driver Board
  26. //#define USE_HSPI_FOR_EPD
  27. // base class GxEPD2_GFX can be used to pass references or pointers to the display instance as parameter, uses ~1.2k more code
  28. // enable or disable GxEPD2_GFX base class
  29. #define ENABLE_GxEPD2_GFX 0
  30. // uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX
  31. //#include <GFX.h>
  32. // Note: if you use this with ENABLE_GxEPD2_GFX 1:
  33. // uncomment it in GxEPD2_GFX.h too, or add #include <GFX.h> before any #include <GxEPD2_GFX.h>
  34. #include <GxEPD2_BW.h>
  35. #include <GxEPD2_3C.h>
  36. #include <GxEPD2_4C.h>
  37. #include <GxEPD2_7C.h>
  38. #include <Fonts/FreeMonoBold9pt7b.h>
  39. // select the display constructor line in one of the following files (old style):
  40. #include "GxEPD2_display_selection.h"
  41. #include "GxEPD2_display_selection_added.h"
  42. // or select the display class and display driver class in the following file (new style):
  43. #include "GxEPD2_display_selection_new_style.h"
  44. #if !defined(__AVR) && !defined(STM32F1xx)
  45. // note 16.11.2019: the compiler may exclude code based on constant if statements (display.epd2.panel == constant),
  46. // therefore bitmaps may get optimized out by the linker
  47. // comment out unused bitmaps to reduce code space used
  48. #include "bitmaps/Bitmaps80x128.h" // 1.02" b/w
  49. #include "bitmaps/Bitmaps152x152.h" // 1.54" b/w
  50. #include "bitmaps/Bitmaps200x200.h" // 1.54" b/w
  51. #include "bitmaps/Bitmaps104x212.h" // 2.13" b/w flexible GDEW0213I5F
  52. #include "bitmaps/Bitmaps128x250.h" // 2.13" b/w
  53. #include "bitmaps/Bitmaps128x296.h" // 2.9" b/w
  54. #include "bitmaps/Bitmaps152x296.h" // 2.6" b/w
  55. #include "bitmaps/Bitmaps176x264.h" // 2.7" b/w
  56. #include "bitmaps/Bitmaps240x360.h" // 3.1" b/w
  57. #include "bitmaps/Bitmaps240x416.h" // 3.71" b/w
  58. #include "bitmaps/Bitmaps400x300.h" // 4.2" b/w
  59. #include "bitmaps/Bitmaps648x480.h" // 5.38" b/w
  60. #include "bitmaps/Bitmaps640x384.h" // 7.5" b/w
  61. #include "bitmaps/Bitmaps800x480.h" // 7.5" b/w
  62. #include "bitmaps/Bitmaps960x640.h" // 10.2" b/w
  63. #include "bitmaps/Bitmaps960x680.h" // 13.3" b/w
  64. // 3-color
  65. #include "bitmaps/Bitmaps3c200x200.h" // 1.54" b/w/r
  66. #include "bitmaps/Bitmaps3c104x212.h" // 2.13" b/w/r
  67. #include "bitmaps/Bitmaps3c128x250.h" // 2.13" b/w/r
  68. #include "bitmaps/Bitmaps3c128x296.h" // 2.9" b/w/r
  69. #include "bitmaps/Bitmaps3c152x296.h" // 2.66" b/w/r
  70. #include "bitmaps/Bitmaps3c176x264.h" // 2.7" b/w/r
  71. #include "bitmaps/Bitmaps3c400x300.h" // 4.2" b/w/r
  72. #if defined(ESP8266) || defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
  73. #include "bitmaps/Bitmaps3c648x480.h" // 5.83" b/w/r
  74. #include "bitmaps/Bitmaps3c800x480.h" // 7.5" b/w/r
  75. #include "bitmaps/Bitmaps3c880x528.h" // 7.5" b/w/r
  76. #include "bitmaps/Bitmaps3c960x640.h" // 11.6" b/w/r
  77. #include "bitmaps/Bitmaps3c960x680.h" // 13.3" b/w/r
  78. #include "bitmaps/WS_Bitmaps800x600.h" // 6.0" grey
  79. // 4-color
  80. #include "bitmaps/Bitmaps4c128x250.h" // 2.13" 4-color
  81. #include "bitmaps/Bitmaps4c184x360.h" // 2.66" 4-color
  82. #include "bitmaps/Bitmaps4c168x384.h" // 2.9" 4-color
  83. #include "bitmaps/WS_Bitmaps4c168x168.h" // 4.37" 4-color
  84. #include "bitmaps/WS_Bitmaps4c168x400.h" // 3.00" 4-color
  85. #include "bitmaps/Bitmaps4c400x300.h" // 4.2"" 4-color
  86. // 7-color
  87. #include "bitmaps/WS_Bitmaps7c192x143.h" // 5.65" 7-color
  88. #include "bitmaps/WS_Bitmaps7c300x180.h" // 7.3" 7-color
  89. #endif
  90. #if defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
  91. #include "bitmaps/Bitmaps1304x984.h" // 12.48" b/w
  92. #include "bitmaps/Bitmaps3c1304x984.h" // 12.48" b/w/r
  93. #include "bitmaps/Bitmaps7c800x480.h" // 7.3" 7-color
  94. #endif
  95. #else
  96. // select only one to fit in code space
  97. //#include "bitmaps/Bitmaps80x128.h" // 1.02" b/w
  98. #include "bitmaps/Bitmaps200x200.h" // 1.54" b/w
  99. //#include "bitmaps/Bitmaps104x212.h" // 2.13" b/w flexible GDEW0213I5F
  100. //#include "bitmaps/Bitmaps128x250.h" // 2.13" b/w
  101. //#include "bitmaps/Bitmaps128x296.h" // 2.9" b/w
  102. //#include "bitmaps/Bitmaps176x264.h" // 2.7" b/w
  103. ////#include "bitmaps/Bitmaps400x300.h" // 4.2" b/w // not enough code space
  104. ////#include "bitmaps/Bitmaps640x384.h" // 7.5" b/w // not enough code space
  105. ////#include "bitmaps/Bitmaps800x480.h" // 7.5" b/w // not enough code space
  106. // 3-color
  107. //#include "bitmaps/Bitmaps3c200x200.h" // 1.54" b/w/r
  108. //#include "bitmaps/Bitmaps3c104x212.h" // 2.13" b/w/r
  109. #include "bitmaps/Bitmaps3c128x250.h" // 2.13" b/w/r
  110. //#include "bitmaps/Bitmaps3c128x296.h" // 2.9" b/w/r
  111. //#include "bitmaps/Bitmaps3c176x264.h" // 2.7" b/w/r
  112. ////#include "bitmaps/Bitmaps3c400x300.h" // 4.2" b/w/r // not enough code space
  113. #endif
  114. #if defined(ARDUINO_ARCH_RP2040) && (defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_RASPBERRY_PI_PICO_W))
  115. #if defined(__MBED__)
  116. // SPI pins used by GoodDisplay DESPI-PICO. note: steals standard I2C pins PIN_WIRE_SDA (6), PIN_WIRE_SCL (7)
  117. // uncomment next line for use with GoodDisplay DESPI-PICO. // MbedSPI(int miso, int mosi, int sck);
  118. arduino::MbedSPI SPIn(4, 7, 6); // need be valid pins for same SPI channel, else fails blinking 4 long 4 short
  119. // uncomment next line for use with my proto board. // MbedSPI(int miso, int mosi, int sck);
  120. //arduino::MbedSPI SPIn(4, 3, 2); // need be valid pins for same SPI channel, else fails blinking 4 long 4 short
  121. // uncomment next line for use with Waveshare Pico-ePaper-2.9. // MbedSPI(int miso, int mosi, int sck);
  122. // note: doesn't work with Waveshare PhotoPainter, conflict on pin 12. use philhower package instead.
  123. //arduino::MbedSPI SPIn(12, 11, 10); // need be valid pins for same SPI channel, else fails blinking 4 long 4 short
  124. #else // package https://github.com/earlephilhower/arduino-pico
  125. // SPIClassRP2040(spi_inst_t *spi, pin_size_t rx, pin_size_t cs, pin_size_t sck, pin_size_t tx);
  126. // uncomment next line for use with my proto board.
  127. //SPIClassRP2040 SPIn(spi0, 4, 5, 2, 3); // need be valid pins for same SPI channel, else fails blinking 4 long 4 short
  128. // uncomment next line for use with Waveshare Pico-ePaper-2.9 or Waveshare PhotoPainter module
  129. SPIClassRP2040 SPIn(spi1, 12, 13, 10, 11); // need be valid pins for same SPI channel, else fails blinking 4 long 4 short
  130. #endif
  131. #endif
  132. #if defined(ESP32) && defined(USE_HSPI_FOR_EPD)
  133. SPIClass hspi(HSPI);
  134. #endif
  135. void setup()
  136. {
  137. Serial.begin(115200);
  138. Serial.println();
  139. Serial.println("setup");
  140. delay(100);
  141. #if defined(ARDUINO_ARCH_RP2040) && (defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_RASPBERRY_PI_PICO_W))
  142. // uncomment next line for use with GoodDisplay DESPI-PICO or my proto board, or Waveshare RPi boards
  143. display.epd2.selectSPI(SPIn, SPISettings(4000000, MSBFIRST, SPI_MODE0));
  144. // uncomment next 2 lines to allow recovery from configuration failures
  145. pinMode(15, INPUT_PULLUP); // safety pin
  146. while (!digitalRead(15)) delay(100); // check safety pin for fail recovery
  147. // recovery can be done also by holding BOOTSEL during power-up.
  148. // uncomment next line for Waveshare PhotoPainter module
  149. pinMode(16, OUTPUT); digitalWrite(16, HIGH); // power to the paper
  150. #endif
  151. #if defined(ESP32) && defined(USE_HSPI_FOR_EPD)
  152. hspi.begin(13, 12, 14, 15); // remap hspi for EPD (swap pins)
  153. display.epd2.selectSPI(hspi, SPISettings(4000000, MSBFIRST, SPI_MODE0));
  154. #elif (defined(ARDUINO_ARCH_ESP32) && defined(ARDUINO_LOLIN_S2_MINI))
  155. // SPI.begin(sck, miso, mosi, ss); // preset for remapped pins
  156. SPI.begin(18, -1, 16, 33); // my LOLIN ESP32 S2 mini connection
  157. #endif
  158. //display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02
  159. display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse
  160. //display.init(115200, true, 10, false, SPIn, SPISettings(4000000, MSBFIRST, SPI_MODE0)); // extended init method with SPI channel and/or settings selection
  161. if (display.pages() > 1)
  162. {
  163. delay(100);
  164. Serial.print("pages = "); Serial.print(display.pages()); Serial.print(" page height = "); Serial.println(display.pageHeight());
  165. delay(1000);
  166. }
  167. // first update should be full refresh
  168. helloWorld();
  169. delay(1000);
  170. // partial refresh mode can be used to full screen,
  171. // effective if display panel hasFastPartialUpdate
  172. helloFullScreenPartialMode();
  173. delay(1000);
  174. //stripeTest(); return; // GDEH029Z13 issue
  175. helloArduino();
  176. delay(1000);
  177. helloEpaper();
  178. delay(1000);
  179. //helloValue(123.9, 1);
  180. //delay(1000);
  181. showFont("FreeMonoBold9pt7b", &FreeMonoBold9pt7b);
  182. delay(1000);
  183. if (display.epd2.WIDTH < 104)
  184. {
  185. showFont("glcdfont", 0);
  186. delay(1000);
  187. }
  188. //drawGrid(); return;
  189. drawBitmaps();
  190. drawGraphics();
  191. //return;
  192. #if !defined(__AVR) // takes too long!
  193. if ((display.epd2.panel == GxEPD2::ACeP565) || (display.epd2.panel == GxEPD2::GDEY073D46) || (display.epd2.panel == GxEPD2::ACeP730))
  194. {
  195. //draw7colorlines();
  196. //delay(2000);
  197. draw7colors();
  198. delay(4000);
  199. //return;
  200. }
  201. #endif
  202. if (display.epd2.hasPartialUpdate)
  203. {
  204. showPartialUpdate();
  205. delay(1000);
  206. } // else // on GDEW0154Z04 only full update available, doesn't look nice
  207. //drawCornerTest();
  208. //showBox(16, 16, 48, 32, false);
  209. //showBox(16, 56, 48, 32, true);
  210. display.powerOff();
  211. deepSleepTest();
  212. #if defined(ESP32) && defined(_GxBitmaps1304x984_H_)
  213. drawBitmaps1304x984();
  214. display.powerOff();
  215. #endif
  216. Serial.println("setup done");
  217. display.end();
  218. }
  219. void loop()
  220. {
  221. }
  222. // note for partial update window and setPartialWindow() method:
  223. // partial update window size and position is on byte boundary in physical x direction
  224. // the size is increased in setPartialWindow() if x or w are not multiple of 8 for even rotation, y or h for odd rotation
  225. // see also comment in GxEPD2_BW.h, GxEPD2_3C.h or GxEPD2_GFX.h for method setPartialWindow()
  226. const char HelloWorld[] = "Hello World!";
  227. const char HelloArduino[] = "Hello Arduino!";
  228. const char HelloEpaper[] = "Hello E-Paper!";
  229. void helloWorld()
  230. {
  231. //Serial.println("helloWorld");
  232. display.setRotation(1);
  233. display.setFont(&FreeMonoBold9pt7b);
  234. if (display.epd2.WIDTH < 104) display.setFont(0);
  235. display.setTextColor(GxEPD_BLACK);
  236. int16_t tbx, tby; uint16_t tbw, tbh;
  237. display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  238. // center bounding box by transposition of origin:
  239. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  240. uint16_t y = ((display.height() - tbh) / 2) - tby;
  241. display.setFullWindow();
  242. display.firstPage();
  243. do
  244. {
  245. display.fillScreen(GxEPD_WHITE);
  246. display.setCursor(x, y);
  247. display.print(HelloWorld);
  248. }
  249. while (display.nextPage());
  250. //Serial.println("helloWorld done");
  251. }
  252. void helloWorldForDummies()
  253. {
  254. //Serial.println("helloWorld");
  255. const char text[] = "Hello World!";
  256. // most e-papers have width < height (portrait) as native orientation, especially the small ones
  257. // in GxEPD2 rotation 0 is used for native orientation (most TFT libraries use 0 fix for portrait orientation)
  258. // set rotation to 1 (rotate right 90 degrees) to have enough space on small displays (landscape)
  259. display.setRotation(1);
  260. // select a suitable font in Adafruit_GFX
  261. display.setFont(&FreeMonoBold9pt7b);
  262. // on e-papers black on white is more pleasant to read
  263. display.setTextColor(GxEPD_BLACK);
  264. // Adafruit_GFX has a handy method getTextBounds() to determine the boundary box for a text for the actual font
  265. int16_t tbx, tby; uint16_t tbw, tbh; // boundary box window
  266. display.getTextBounds(text, 0, 0, &tbx, &tby, &tbw, &tbh); // it works for origin 0, 0, fortunately (negative tby!)
  267. // center bounding box by transposition of origin:
  268. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  269. uint16_t y = ((display.height() - tbh) / 2) - tby;
  270. // full window mode is the initial mode, set it anyway
  271. display.setFullWindow();
  272. // here we use paged drawing, even if the processor has enough RAM for full buffer
  273. // so this can be used with any supported processor board.
  274. // the cost in code overhead and execution time penalty is marginal
  275. // tell the graphics class to use paged drawing mode
  276. display.firstPage();
  277. do
  278. {
  279. // this part of code is executed multiple times, as many as needed,
  280. // in case of full buffer it is executed once
  281. // IMPORTANT: each iteration needs to draw the same, to avoid strange effects
  282. // use a copy of values that might change, don't read e.g. from analog or pins in the loop!
  283. display.fillScreen(GxEPD_WHITE); // set the background to white (fill the buffer with value for white)
  284. display.setCursor(x, y); // set the postition to start printing text
  285. display.print(text); // print some text
  286. // end of part executed multiple times
  287. }
  288. // tell the graphics class to transfer the buffer content (page) to the controller buffer
  289. // the graphics class will command the controller to refresh to the screen when the last page has been transferred
  290. // returns true if more pages need be drawn and transferred
  291. // returns false if the last page has been transferred and the screen refreshed for panels without fast partial update
  292. // returns false for panels with fast partial update when the controller buffer has been written once more, to make the differential buffers equal
  293. // (for full buffered with fast partial update the (full) buffer is just transferred again, and false returned)
  294. while (display.nextPage());
  295. //Serial.println("helloWorld done");
  296. }
  297. void helloFullScreenPartialMode()
  298. {
  299. //Serial.println("helloFullScreenPartialMode");
  300. const char fullscreen[] = "full screen update";
  301. const char fpm[] = "fast partial mode";
  302. const char spm[] = "slow partial mode";
  303. const char npm[] = "no partial mode";
  304. display.setPartialWindow(0, 0, display.width(), display.height());
  305. display.setRotation(1);
  306. display.setFont(&FreeMonoBold9pt7b);
  307. if (display.epd2.WIDTH < 104) display.setFont(0);
  308. display.setTextColor(GxEPD_BLACK);
  309. const char* updatemode;
  310. if (display.epd2.hasFastPartialUpdate)
  311. {
  312. updatemode = fpm;
  313. }
  314. else if (display.epd2.hasPartialUpdate)
  315. {
  316. updatemode = spm;
  317. }
  318. else
  319. {
  320. updatemode = npm;
  321. }
  322. // do this outside of the loop
  323. int16_t tbx, tby; uint16_t tbw, tbh;
  324. // center update text
  325. display.getTextBounds(fullscreen, 0, 0, &tbx, &tby, &tbw, &tbh);
  326. uint16_t utx = ((display.width() - tbw) / 2) - tbx;
  327. uint16_t uty = ((display.height() / 4) - tbh / 2) - tby;
  328. // center update mode
  329. display.getTextBounds(updatemode, 0, 0, &tbx, &tby, &tbw, &tbh);
  330. uint16_t umx = ((display.width() - tbw) / 2) - tbx;
  331. uint16_t umy = ((display.height() * 3 / 4) - tbh / 2) - tby;
  332. // center HelloWorld
  333. display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  334. uint16_t hwx = ((display.width() - tbw) / 2) - tbx;
  335. uint16_t hwy = ((display.height() - tbh) / 2) - tby;
  336. display.firstPage();
  337. do
  338. {
  339. display.fillScreen(GxEPD_WHITE);
  340. display.setCursor(hwx, hwy);
  341. display.print(HelloWorld);
  342. display.setCursor(utx, uty);
  343. display.print(fullscreen);
  344. display.setCursor(umx, umy);
  345. display.print(updatemode);
  346. }
  347. while (display.nextPage());
  348. //Serial.println("helloFullScreenPartialMode done");
  349. }
  350. void helloArduino()
  351. {
  352. //Serial.println("helloArduino");
  353. display.setRotation(1);
  354. display.setFont(&FreeMonoBold9pt7b);
  355. if (display.epd2.WIDTH < 104) display.setFont(0);
  356. display.setTextColor(display.epd2.hasColor ? GxEPD_RED : GxEPD_BLACK);
  357. int16_t tbx, tby; uint16_t tbw, tbh;
  358. // align with centered HelloWorld
  359. display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  360. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  361. // height might be different
  362. display.getTextBounds(HelloArduino, 0, 0, &tbx, &tby, &tbw, &tbh);
  363. uint16_t y = ((display.height() / 4) - tbh / 2) - tby; // y is base line!
  364. // make the window big enough to cover (overwrite) descenders of previous text
  365. uint16_t wh = FreeMonoBold9pt7b.yAdvance;
  366. uint16_t wy = (display.height() / 4) - wh / 2;
  367. display.setPartialWindow(0, wy, display.width(), wh);
  368. display.firstPage();
  369. do
  370. {
  371. display.fillScreen(GxEPD_WHITE);
  372. //display.drawRect(x, y - tbh, tbw, tbh, GxEPD_BLACK);
  373. display.setCursor(x, y);
  374. display.print(HelloArduino);
  375. }
  376. while (display.nextPage());
  377. delay(1000);
  378. //Serial.println("helloArduino done");
  379. }
  380. void helloEpaper()
  381. {
  382. //Serial.println("helloEpaper");
  383. display.setRotation(1);
  384. display.setFont(&FreeMonoBold9pt7b);
  385. if (display.epd2.WIDTH < 104) display.setFont(0);
  386. display.setTextColor(display.epd2.hasColor ? GxEPD_RED : GxEPD_BLACK);
  387. int16_t tbx, tby; uint16_t tbw, tbh;
  388. // align with centered HelloWorld
  389. display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  390. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  391. // height might be different
  392. display.getTextBounds(HelloEpaper, 0, 0, &tbx, &tby, &tbw, &tbh);
  393. uint16_t y = ((display.height() * 3 / 4) - tbh / 2) - tby; // y is base line!
  394. // make the window big enough to cover (overwrite) descenders of previous text
  395. uint16_t wh = FreeMonoBold9pt7b.yAdvance;
  396. uint16_t wy = (display.height() * 3 / 4) - wh / 2;
  397. display.setPartialWindow(0, wy, display.width(), wh);
  398. display.firstPage();
  399. do
  400. {
  401. display.fillScreen(GxEPD_WHITE);
  402. display.setCursor(x, y);
  403. display.print(HelloEpaper);
  404. }
  405. while (display.nextPage());
  406. //Serial.println("helloEpaper done");
  407. }
  408. // test partial window issue on GDEW0213Z19 and GDEH029Z13
  409. void stripeTest()
  410. {
  411. helloStripe(104);
  412. delay(2000);
  413. helloStripe(96);
  414. }
  415. const char HelloStripe[] = "Hello Stripe!";
  416. void helloStripe(uint16_t pw_xe) // end of partial window in physcal x direction
  417. {
  418. //Serial.print("HelloStripe("); Serial.print(pw_xe); Serial.println(")");
  419. display.setRotation(3);
  420. display.setFont(&FreeMonoBold9pt7b);
  421. display.setTextColor(display.epd2.hasColor ? GxEPD_RED : GxEPD_BLACK);
  422. int16_t tbx, tby; uint16_t tbw, tbh;
  423. display.getTextBounds(HelloStripe, 0, 0, &tbx, &tby, &tbw, &tbh);
  424. uint16_t wh = FreeMonoBold9pt7b.yAdvance;
  425. uint16_t wy = pw_xe - wh;
  426. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  427. uint16_t y = wy - tby;
  428. display.setPartialWindow(0, wy, display.width(), wh);
  429. display.firstPage();
  430. do
  431. {
  432. display.fillScreen(GxEPD_WHITE);
  433. display.setCursor(x, y);
  434. display.print(HelloStripe);
  435. }
  436. while (display.nextPage());
  437. //Serial.println("HelloStripe done");
  438. }
  439. #if defined(ESP8266) || defined(ESP32)
  440. #include <StreamString.h>
  441. #define PrintString StreamString
  442. #else
  443. class PrintString : public Print, public String
  444. {
  445. public:
  446. size_t write(uint8_t data) override
  447. {
  448. return concat(char(data));
  449. };
  450. };
  451. #endif
  452. void helloValue(double v, int digits)
  453. {
  454. //Serial.println("helloValue");
  455. display.setRotation(1);
  456. display.setFont(&FreeMonoBold9pt7b);
  457. display.setTextColor(display.epd2.hasColor ? GxEPD_RED : GxEPD_BLACK);
  458. PrintString valueString;
  459. valueString.print(v, digits);
  460. int16_t tbx, tby; uint16_t tbw, tbh;
  461. display.getTextBounds(valueString, 0, 0, &tbx, &tby, &tbw, &tbh);
  462. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  463. uint16_t y = ((display.height() * 3 / 4) - tbh / 2) - tby; // y is base line!
  464. // show what happens, if we use the bounding box for partial window
  465. uint16_t wx = (display.width() - tbw) / 2;
  466. uint16_t wy = ((display.height() * 3 / 4) - tbh / 2);
  467. display.setPartialWindow(wx, wy, tbw, tbh);
  468. display.firstPage();
  469. do
  470. {
  471. display.fillScreen(GxEPD_WHITE);
  472. display.setCursor(x, y);
  473. display.print(valueString);
  474. }
  475. while (display.nextPage());
  476. delay(2000);
  477. // make the partial window big enough to cover the previous text
  478. uint16_t ww = tbw; // remember window width
  479. display.getTextBounds(HelloEpaper, 0, 0, &tbx, &tby, &tbw, &tbh);
  480. // adjust, because HelloEpaper was aligned, not centered (could calculate this to be precise)
  481. ww = max(ww, uint16_t(tbw + 12)); // 12 seems ok
  482. wx = (display.width() - tbw) / 2;
  483. // make the window big enough to cover (overwrite) descenders of previous text
  484. uint16_t wh = FreeMonoBold9pt7b.yAdvance;
  485. wy = (display.height() * 3 / 4) - wh / 2;
  486. display.setPartialWindow(wx, wy, ww, wh);
  487. // alternately use the whole width for partial window
  488. //display.setPartialWindow(0, wy, display.width(), wh);
  489. display.firstPage();
  490. do
  491. {
  492. display.fillScreen(GxEPD_WHITE);
  493. display.setCursor(x, y);
  494. display.print(valueString);
  495. }
  496. while (display.nextPage());
  497. //Serial.println("helloValue done");
  498. }
  499. void deepSleepTest()
  500. {
  501. //Serial.println("deepSleepTest");
  502. const char hibernating[] = "hibernating ...";
  503. const char wokeup[] = "woke up";
  504. const char from[] = "from deep sleep";
  505. const char again[] = "again";
  506. display.setRotation(1);
  507. display.setFont(&FreeMonoBold9pt7b);
  508. if (display.epd2.WIDTH < 104) display.setFont(0);
  509. display.setTextColor(GxEPD_BLACK);
  510. int16_t tbx, tby; uint16_t tbw, tbh;
  511. // center text
  512. display.getTextBounds(hibernating, 0, 0, &tbx, &tby, &tbw, &tbh);
  513. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  514. uint16_t y = ((display.height() - tbh) / 2) - tby;
  515. display.setFullWindow();
  516. display.firstPage();
  517. do
  518. {
  519. display.fillScreen(GxEPD_WHITE);
  520. display.setCursor(x, y);
  521. display.print(hibernating);
  522. }
  523. while (display.nextPage());
  524. display.hibernate();
  525. delay(5000);
  526. display.getTextBounds(wokeup, 0, 0, &tbx, &tby, &tbw, &tbh);
  527. uint16_t wx = (display.width() - tbw) / 2;
  528. uint16_t wy = ((display.height() / 3) - tbh / 2) - tby; // y is base line!
  529. display.getTextBounds(from, 0, 0, &tbx, &tby, &tbw, &tbh);
  530. uint16_t fx = (display.width() - tbw) / 2;
  531. uint16_t fy = ((display.height() * 2 / 3) - tbh / 2) - tby; // y is base line!
  532. display.firstPage();
  533. do
  534. {
  535. display.fillScreen(GxEPD_WHITE);
  536. display.setCursor(wx, wy);
  537. display.print(wokeup);
  538. display.setCursor(fx, fy);
  539. display.print(from);
  540. }
  541. while (display.nextPage());
  542. delay(5000);
  543. display.getTextBounds(hibernating, 0, 0, &tbx, &tby, &tbw, &tbh);
  544. uint16_t hx = (display.width() - tbw) / 2;
  545. uint16_t hy = ((display.height() / 3) - tbh / 2) - tby; // y is base line!
  546. display.getTextBounds(again, 0, 0, &tbx, &tby, &tbw, &tbh);
  547. uint16_t ax = (display.width() - tbw) / 2;
  548. uint16_t ay = ((display.height() * 2 / 3) - tbh / 2) - tby; // y is base line!
  549. display.firstPage();
  550. do
  551. {
  552. display.fillScreen(GxEPD_WHITE);
  553. display.setCursor(hx, hy);
  554. display.print(hibernating);
  555. display.setCursor(ax, ay);
  556. display.print(again);
  557. }
  558. while (display.nextPage());
  559. display.hibernate();
  560. //Serial.println("deepSleepTest done");
  561. }
  562. void showBox(uint16_t x, uint16_t y, uint16_t w, uint16_t h, bool partial)
  563. {
  564. //Serial.println("showBox");
  565. display.setRotation(1);
  566. if (partial)
  567. {
  568. display.setPartialWindow(x, y, w, h);
  569. }
  570. else
  571. {
  572. display.setFullWindow();
  573. }
  574. display.firstPage();
  575. do
  576. {
  577. display.fillScreen(GxEPD_WHITE);
  578. display.fillRect(x, y, w, h, GxEPD_BLACK);
  579. }
  580. while (display.nextPage());
  581. //Serial.println("showBox done");
  582. }
  583. void drawCornerTest()
  584. {
  585. display.setFullWindow();
  586. display.setFont(&FreeMonoBold9pt7b);
  587. display.setTextColor(GxEPD_BLACK);
  588. for (uint16_t r = 0; r <= 4; r++)
  589. {
  590. display.setRotation(r);
  591. display.firstPage();
  592. do
  593. {
  594. display.fillScreen(GxEPD_WHITE);
  595. display.fillRect(0, 0, 8, 8, GxEPD_BLACK);
  596. display.fillRect(display.width() - 18, 0, 16, 16, GxEPD_BLACK);
  597. display.fillRect(display.width() - 25, display.height() - 25, 24, 24, GxEPD_BLACK);
  598. display.fillRect(0, display.height() - 33, 32, 32, GxEPD_BLACK);
  599. display.setCursor(display.width() / 2, display.height() / 2);
  600. display.print(display.getRotation());
  601. }
  602. while (display.nextPage());
  603. delay(2000);
  604. }
  605. }
  606. void showFont(const char name[], const GFXfont* f)
  607. {
  608. display.setFullWindow();
  609. display.setRotation(0);
  610. display.setTextColor(GxEPD_BLACK);
  611. display.firstPage();
  612. do
  613. {
  614. drawFont(name, f);
  615. }
  616. while (display.nextPage());
  617. }
  618. void drawFont(const char name[], const GFXfont* f)
  619. {
  620. //display.setRotation(0);
  621. display.fillScreen(GxEPD_WHITE);
  622. display.setTextColor(GxEPD_BLACK);
  623. display.setFont(f);
  624. display.setCursor(0, 0);
  625. display.println();
  626. display.println(name);
  627. display.println(" !\"#$%&'()*+,-./");
  628. display.println("0123456789:;<=>?");
  629. display.println("@ABCDEFGHIJKLMNO");
  630. display.println("PQRSTUVWXYZ[\\]^_");
  631. if (display.epd2.hasColor)
  632. {
  633. display.setTextColor(GxEPD_RED);
  634. }
  635. display.println("`abcdefghijklmno");
  636. display.println("pqrstuvwxyz{|}~ ");
  637. }
  638. // note for partial update window and setPartialWindow() method:
  639. // partial update window size and position is on byte boundary in physical x direction
  640. // the size is increased in setPartialWindow() if x or w are not multiple of 8 for even rotation, y or h for odd rotation
  641. // see also comment in GxEPD2_BW.h, GxEPD2_3C.h or GxEPD2_GFX.h for method setPartialWindow()
  642. // showPartialUpdate() purposely uses values that are not multiples of 8 to test this
  643. void showPartialUpdate()
  644. {
  645. // some useful background
  646. helloWorld();
  647. // use asymmetric values for test
  648. uint16_t box_x = 10;
  649. uint16_t box_y = 15;
  650. uint16_t box_w = 70;
  651. uint16_t box_h = 20;
  652. uint16_t cursor_y = box_y + box_h - 6;
  653. if (display.epd2.WIDTH < 104) cursor_y = box_y + 6;
  654. float value = 13.95;
  655. uint16_t incr = display.epd2.hasFastPartialUpdate ? 1 : 3;
  656. display.setFont(&FreeMonoBold9pt7b);
  657. if (display.epd2.WIDTH < 104) display.setFont(0);
  658. display.setTextColor(GxEPD_BLACK);
  659. // show where the update box is
  660. for (uint16_t r = 0; r < 4; r++)
  661. {
  662. display.setRotation(r);
  663. display.setPartialWindow(box_x, box_y, box_w, box_h);
  664. display.firstPage();
  665. do
  666. {
  667. display.fillRect(box_x, box_y, box_w, box_h, GxEPD_BLACK);
  668. //display.fillScreen(GxEPD_BLACK);
  669. }
  670. while (display.nextPage());
  671. delay(2000);
  672. display.firstPage();
  673. do
  674. {
  675. display.fillRect(box_x, box_y, box_w, box_h, GxEPD_WHITE);
  676. }
  677. while (display.nextPage());
  678. delay(1000);
  679. }
  680. //return;
  681. // show updates in the update box
  682. for (uint16_t r = 0; r < 4; r++)
  683. {
  684. display.setRotation(r);
  685. display.setPartialWindow(box_x, box_y, box_w, box_h);
  686. for (uint16_t i = 1; i <= 10; i += incr)
  687. {
  688. display.firstPage();
  689. do
  690. {
  691. display.fillRect(box_x, box_y, box_w, box_h, GxEPD_WHITE);
  692. display.setCursor(box_x, cursor_y);
  693. display.print(value * i, 2);
  694. }
  695. while (display.nextPage());
  696. delay(500);
  697. }
  698. delay(1000);
  699. display.firstPage();
  700. do
  701. {
  702. display.fillRect(box_x, box_y, box_w, box_h, GxEPD_WHITE);
  703. }
  704. while (display.nextPage());
  705. delay(1000);
  706. }
  707. }
  708. void drawGrid()
  709. {
  710. uint16_t x, y;
  711. display.firstPage();
  712. do
  713. {
  714. x = 0;
  715. do
  716. {
  717. display.drawLine(x, 0, x, display.height() - 1, GxEPD_BLACK);
  718. x += 10;
  719. }
  720. while (x < display.width());
  721. y = 0;
  722. do
  723. {
  724. display.drawLine(0, y, display.width() - 1, y, GxEPD_BLACK);
  725. y += 10;
  726. }
  727. while (y < display.height());
  728. x = 0;
  729. do
  730. {
  731. display.fillCircle(x, display.height() / 2, 3, GxEPD_BLACK);
  732. x += 50;
  733. }
  734. while (x <= display.width());
  735. y = 0;
  736. do
  737. {
  738. display.fillCircle(display.width() / 2, y, 3, GxEPD_BLACK);
  739. y += 50;
  740. }
  741. while (y <= display.height());
  742. }
  743. while (display.nextPage());
  744. }
  745. void drawBitmaps()
  746. {
  747. display.setRotation(0);
  748. display.setFullWindow();
  749. #ifdef _GxBitmaps80x128_H_
  750. drawBitmaps80x128();
  751. #endif
  752. #ifdef _GxBitmaps152x152_H_
  753. drawBitmaps152x152();
  754. #endif
  755. #ifdef _GxBitmaps104x212_H_
  756. drawBitmaps104x212();
  757. #endif
  758. #ifdef _GxBitmaps128x250_H_
  759. drawBitmaps128x250();
  760. #endif
  761. #ifdef _GxBitmaps128x296_H_
  762. drawBitmaps128x296();
  763. #endif
  764. #ifdef _GxBitmaps152x296_H_
  765. drawBitmaps152x296();
  766. #endif
  767. #ifdef _GxBitmaps240x320_H_
  768. drawBitmaps240x320();
  769. #endif
  770. #ifdef _GxBitmaps176x264_H_
  771. drawBitmaps176x264();
  772. #endif
  773. #ifdef _GxBitmaps240x416_H_
  774. drawBitmaps240x416();
  775. #endif
  776. #ifdef _GxBitmaps400x300_H_
  777. drawBitmaps400x300();
  778. #endif
  779. #ifdef _GxBitmaps640x384_H_
  780. drawBitmaps640x384();
  781. #endif
  782. #ifdef _GxBitmaps648x480_H_
  783. drawBitmaps648x480();
  784. #endif
  785. #ifdef _GxBitmaps800x480_H_
  786. drawBitmaps800x480();
  787. #endif
  788. #ifdef _WS_Bitmaps800x600_H_
  789. drawBitmaps800x600();
  790. #endif
  791. #if defined(ESP32) && defined(_GxBitmaps960x640_H_)
  792. drawBitmaps960x640();
  793. #endif
  794. #if defined(ESP32) && defined(_GxBitmaps960x680_H_)
  795. drawBitmaps960x680();
  796. #endif
  797. #if defined(ESP32) && defined(_GxBitmaps1304x984_H_)
  798. drawBitmaps1304x984();
  799. #endif
  800. // 3-color
  801. #ifdef _GxBitmaps3c104x212_H_
  802. drawBitmaps3c104x212();
  803. #endif
  804. #ifdef _GxBitmaps3c128x250_H_
  805. drawBitmaps3c128x250();
  806. #endif
  807. #ifdef _GxBitmaps3c128x296_H_
  808. drawBitmaps3c128x296();
  809. #endif
  810. #ifdef _GxBitmaps3c152x296_H_
  811. drawBitmaps3c152x296();
  812. #endif
  813. #ifdef _GxBitmaps3c176x264_H_
  814. drawBitmaps3c176x264();
  815. #endif
  816. #ifdef _GxBitmaps3c400x300_H_
  817. drawBitmaps3c400x300();
  818. #endif
  819. #ifdef _GxBitmaps3c648x480_H_
  820. drawBitmaps3c648x480();
  821. #endif
  822. #ifdef _GxBitmaps3c800x480_H_
  823. drawBitmaps3c800x480();
  824. #endif
  825. #ifdef _GxBitmaps3c880x528_H_
  826. drawBitmaps3c880x528();
  827. #endif
  828. #if defined(ESP32) && defined(_GxBitmaps3c960x640_H_)
  829. drawBitmaps3c960x640();
  830. #endif
  831. #if defined(ESP32) && defined(_GxBitmaps3c960x680_H_)
  832. drawBitmaps3c960x680();
  833. #endif
  834. // 4-color
  835. #if defined(_GxBitmaps4c128x250_H_)
  836. drawBitmaps4c128x250();
  837. #endif
  838. #if defined(_WS_Bitmaps4c168x168_H_)
  839. drawBitmaps4c168x168();
  840. #endif
  841. #if defined(_WS_Bitmaps4c168x168_H_)
  842. drawBitmaps4c168x168();
  843. #endif
  844. #if defined(_GxBitmaps4c168x384_H_)
  845. drawBitmaps4c168x384();
  846. #endif
  847. #if defined(_GxBitmaps4c184x360_H_)
  848. drawBitmaps4c184x360();
  849. #endif
  850. #if defined(_GxBitmaps4c400x300_H_)
  851. drawBitmaps4c400x300();
  852. #endif
  853. #if defined(_WS_Bitmaps7c192x143_H_)
  854. drawBitmaps7c192x143();
  855. #endif
  856. #if defined(_GxBitmaps7c800x480_H_)
  857. drawBitmaps7c800x480();
  858. #endif
  859. #if defined(_WS_Bitmaps7c300x180_H_)
  860. drawBitmaps7c300x180();
  861. #endif
  862. if ((display.epd2.WIDTH >= 200) && (display.epd2.HEIGHT >= 200))
  863. {
  864. // show these after the specific bitmaps
  865. #ifdef _GxBitmaps200x200_H_
  866. drawBitmaps200x200();
  867. #endif
  868. // 3-color
  869. #ifdef _GxBitmaps3c200x200_H_
  870. drawBitmaps3c200x200();
  871. #endif
  872. }
  873. #if defined(ESP32) && defined(_GxBitmaps3c1304x984_H_)
  874. drawBitmaps3c1304x984();
  875. #endif
  876. }
  877. #ifdef _GxBitmaps80x128_H_
  878. void drawBitmaps80x128()
  879. {
  880. #if !defined(__AVR)
  881. const unsigned char* bitmaps[] =
  882. {
  883. Bitmap80x128_1, Bitmap80x128_2, Bitmap80x128_3, Bitmap80x128_4, Bitmap80x128_5
  884. };
  885. #else
  886. const unsigned char* bitmaps[] =
  887. {
  888. Bitmap80x128_1, Bitmap80x128_2, Bitmap80x128_3, Bitmap80x128_4, Bitmap80x128_5
  889. };
  890. #endif
  891. if ((display.epd2.WIDTH == 80) && (display.epd2.HEIGHT == 128))
  892. {
  893. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  894. {
  895. display.firstPage();
  896. do
  897. {
  898. display.fillScreen(GxEPD_WHITE);
  899. display.drawInvertedBitmap(0, 0, bitmaps[i], 80, 128, GxEPD_BLACK);
  900. }
  901. while (display.nextPage());
  902. delay(2000);
  903. }
  904. display.firstPage();
  905. do
  906. {
  907. display.fillScreen(GxEPD_WHITE);
  908. display.drawBitmap(0, 0, WS_Bitmap80x128, 80, 128, GxEPD_BLACK);
  909. }
  910. while (display.nextPage());
  911. delay(2000);
  912. }
  913. }
  914. #endif
  915. #ifdef _GxBitmaps152x152_H_
  916. void drawBitmaps152x152()
  917. {
  918. #if !defined(__AVR)
  919. const unsigned char* bitmaps[] =
  920. {
  921. Bitmap152x152_1, Bitmap152x152_2, Bitmap152x152_3
  922. };
  923. #else
  924. const unsigned char* bitmaps[] =
  925. {
  926. Bitmap152x152_1, Bitmap152x152_2, Bitmap152x152_3
  927. };
  928. #endif
  929. if ((display.epd2.WIDTH == 152) && (display.epd2.HEIGHT == 152))
  930. {
  931. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  932. {
  933. display.firstPage();
  934. do
  935. {
  936. display.fillScreen(GxEPD_WHITE);
  937. display.drawInvertedBitmap(0, 0, bitmaps[i], 152, 152, GxEPD_BLACK);
  938. }
  939. while (display.nextPage());
  940. delay(2000);
  941. }
  942. }
  943. }
  944. #endif
  945. #ifdef _GxBitmaps200x200_H_
  946. void drawBitmaps200x200()
  947. {
  948. #if defined(ARDUINO_AVR_PRO)
  949. const unsigned char* bitmaps[] =
  950. {
  951. logo200x200
  952. };
  953. #elif defined(__AVR)
  954. const unsigned char* bitmaps[] =
  955. {
  956. logo200x200, //first200x200
  957. };
  958. #elif defined(_BOARD_GENERIC_STM32F103C_H_) || defined(STM32F1xx)
  959. const unsigned char* bitmaps[] =
  960. {
  961. logo200x200, first200x200, second200x200, third200x200, //fourth200x200, fifth200x200, sixth200x200, senventh200x200, eighth200x200
  962. };
  963. #else
  964. const unsigned char* bitmaps[] =
  965. {
  966. logo200x200, first200x200, second200x200, third200x200, fourth200x200, fifth200x200, sixth200x200, senventh200x200, eighth200x200
  967. //logo200x200, first200x200, second200x200, fourth200x200, third200x200, fifth200x200, sixth200x200, senventh200x200, eighth200x200 // ED037TC1 test
  968. };
  969. #endif
  970. if (display.epd2.hasColor) return; // to avoid many long refreshes
  971. if ((display.epd2.WIDTH == 200) && (display.epd2.HEIGHT == 200) && !display.epd2.hasColor)
  972. {
  973. bool m = display.mirror(true);
  974. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  975. {
  976. display.firstPage();
  977. do
  978. {
  979. display.fillScreen(GxEPD_WHITE);
  980. display.drawInvertedBitmap(0, 0, bitmaps[i], 200, 200, GxEPD_BLACK);
  981. }
  982. while (display.nextPage());
  983. delay(2000);
  984. }
  985. display.mirror(m);
  986. }
  987. //else
  988. {
  989. bool mirror_y = (display.epd2.panel != GxEPD2::GDE0213B1);
  990. display.clearScreen(); // use default for white
  991. int16_t x = (int16_t(display.epd2.WIDTH) - 200) / 2;
  992. int16_t y = (int16_t(display.epd2.HEIGHT) - 200) / 2;
  993. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  994. {
  995. display.drawImage(bitmaps[i], x, y, 200, 200, false, mirror_y, true);
  996. delay(2000);
  997. }
  998. }
  999. bool mirror_y = (display.epd2.panel != GxEPD2::GDE0213B1);
  1000. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1001. {
  1002. int16_t x = -60;
  1003. int16_t y = -60;
  1004. for (uint16_t j = 0; j < 10; j++)
  1005. {
  1006. display.writeScreenBuffer(); // use default for white
  1007. display.writeImage(bitmaps[i], x, y, 200, 200, false, mirror_y, true);
  1008. display.refresh(true);
  1009. if (display.epd2.hasFastPartialUpdate)
  1010. {
  1011. // for differential update: set previous buffer equal to current buffer in controller
  1012. display.epd2.writeScreenBufferAgain(); // use default for white
  1013. display.epd2.writeImageAgain(bitmaps[i], x, y, 200, 200, false, mirror_y, true);
  1014. }
  1015. delay(2000);
  1016. x += display.epd2.WIDTH / 4;
  1017. y += display.epd2.HEIGHT / 4;
  1018. if ((x >= int16_t(display.epd2.WIDTH)) || (y >= int16_t(display.epd2.HEIGHT))) break;
  1019. }
  1020. if (!display.epd2.hasFastPartialUpdate) break; // comment out for full show
  1021. break; // comment out for full show
  1022. }
  1023. display.writeScreenBuffer(); // use default for white
  1024. display.writeImage(bitmaps[0], int16_t(0), 0, 200, 200, false, mirror_y, true);
  1025. display.writeImage(bitmaps[0], int16_t(int16_t(display.epd2.WIDTH) - 200), int16_t(display.epd2.HEIGHT) - 200, 200, 200, false, mirror_y, true);
  1026. display.refresh(true);
  1027. // for differential update: set previous buffer equal to current buffer in controller
  1028. display.epd2.writeScreenBufferAgain(); // use default for white
  1029. display.epd2.writeImageAgain(bitmaps[0], int16_t(0), 0, 200, 200, false, mirror_y, true);
  1030. display.epd2.writeImageAgain(bitmaps[0], int16_t(int16_t(display.epd2.WIDTH) - 200), int16_t(display.epd2.HEIGHT) - 200, 200, 200, false, mirror_y, true);
  1031. delay(2000);
  1032. }
  1033. #endif
  1034. #ifdef _GxBitmaps104x212_H_
  1035. void drawBitmaps104x212()
  1036. {
  1037. #if !defined(__AVR)
  1038. const unsigned char* bitmaps[] =
  1039. {
  1040. WS_Bitmap104x212, Bitmap104x212_1, Bitmap104x212_2, Bitmap104x212_3
  1041. };
  1042. #else
  1043. const unsigned char* bitmaps[] =
  1044. {
  1045. WS_Bitmap104x212, Bitmap104x212_1, Bitmap104x212_2, Bitmap104x212_3
  1046. };
  1047. #endif
  1048. if ((display.epd2.WIDTH == 104) && (display.epd2.HEIGHT == 212) && !display.epd2.hasColor)
  1049. {
  1050. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1051. {
  1052. display.firstPage();
  1053. do
  1054. {
  1055. display.fillScreen(GxEPD_WHITE);
  1056. display.drawBitmap(0, 0, bitmaps[i], 104, 212, GxEPD_BLACK);
  1057. }
  1058. while (display.nextPage());
  1059. delay(2000);
  1060. }
  1061. }
  1062. }
  1063. #endif
  1064. #ifdef _GxBitmaps128x250_H_
  1065. void drawBitmaps128x250()
  1066. {
  1067. #if !defined(__AVR)
  1068. const unsigned char* bitmaps[] =
  1069. {
  1070. Bitmap128x250_1, logo128x250, first128x250, second128x250, third128x250
  1071. };
  1072. #else
  1073. const unsigned char* bitmaps[] =
  1074. {
  1075. Bitmap128x250_1, logo128x250, first128x250, second128x250, third128x250
  1076. };
  1077. #endif
  1078. if ((display.epd2.WIDTH == 128) && (display.epd2.HEIGHT == 250) && !display.epd2.hasColor)
  1079. {
  1080. bool m = display.mirror(true);
  1081. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1082. {
  1083. display.firstPage();
  1084. do
  1085. {
  1086. display.fillScreen(GxEPD_WHITE);
  1087. display.drawInvertedBitmap(0, 0, bitmaps[i], 128, 250, GxEPD_BLACK);
  1088. }
  1089. while (display.nextPage());
  1090. delay(2000);
  1091. }
  1092. display.mirror(m);
  1093. }
  1094. }
  1095. #endif
  1096. #ifdef _GxBitmaps128x296_H_
  1097. void drawBitmaps128x296()
  1098. {
  1099. #if !defined(__AVR)
  1100. const unsigned char* bitmaps[] =
  1101. {
  1102. Bitmap128x296_1, logo128x296, first128x296, second128x296, third128x296
  1103. };
  1104. #else
  1105. const unsigned char* bitmaps[] =
  1106. {
  1107. Bitmap128x296_1, logo128x296 //, first128x296, second128x296, third128x296
  1108. };
  1109. #endif
  1110. if ((display.epd2.WIDTH == 128) && (display.epd2.HEIGHT == 296) && !display.epd2.hasColor)
  1111. {
  1112. bool m = display.mirror(true);
  1113. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1114. {
  1115. display.firstPage();
  1116. do
  1117. {
  1118. display.fillScreen(GxEPD_WHITE);
  1119. display.drawInvertedBitmap(0, 0, bitmaps[i], 128, 296, GxEPD_BLACK);
  1120. }
  1121. while (display.nextPage());
  1122. delay(2000);
  1123. }
  1124. display.mirror(m);
  1125. }
  1126. }
  1127. #endif
  1128. #ifdef _GxBitmaps152x296_H_
  1129. void drawBitmaps152x296()
  1130. {
  1131. #if !defined(__AVR)
  1132. const unsigned char* bitmaps[] =
  1133. {
  1134. Bitmap152x296_1, Bitmap152x296_2, Bitmap152x296_3
  1135. };
  1136. #else
  1137. const unsigned char* bitmaps[] =
  1138. {
  1139. Bitmap152x296_1, Bitmap152x296_2, Bitmap152x296_3
  1140. };
  1141. #endif
  1142. if ((display.epd2.WIDTH == 152) && (display.epd2.HEIGHT == 296) && !display.epd2.hasColor)
  1143. {
  1144. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1145. {
  1146. display.firstPage();
  1147. do
  1148. {
  1149. display.fillScreen(GxEPD_WHITE);
  1150. display.drawInvertedBitmap(0, 0, bitmaps[i], 152, 296, GxEPD_BLACK);
  1151. }
  1152. while (display.nextPage());
  1153. delay(2000);
  1154. }
  1155. }
  1156. }
  1157. #endif
  1158. #ifdef _GxBitmaps240x320_H_
  1159. void drawBitmaps240x320()
  1160. {
  1161. #if !defined(__AVR)
  1162. const unsigned char* bitmaps[] =
  1163. {
  1164. Bitmap240x320_1, Bitmap240x320_2, Bitmap240x320_3, Bitmap240x320_4, Bitmap240x320_5
  1165. };
  1166. #else
  1167. const unsigned char* bitmaps[] =
  1168. {
  1169. Bitmap240x320_1, Bitmap240x320_2
  1170. };
  1171. #endif
  1172. if ((display.epd2.WIDTH == 240) && (display.epd2.HEIGHT == 320) && !display.epd2.hasColor)
  1173. {
  1174. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1175. {
  1176. display.firstPage();
  1177. do
  1178. {
  1179. display.fillScreen(GxEPD_WHITE);
  1180. display.drawInvertedBitmap(0, 0, bitmaps[i], 240, 320, GxEPD_BLACK);
  1181. }
  1182. while (display.nextPage());
  1183. delay(2000);
  1184. }
  1185. }
  1186. }
  1187. #endif
  1188. #ifdef _GxBitmaps176x264_H_
  1189. void drawBitmaps176x264()
  1190. {
  1191. #if !defined(__AVR)
  1192. const unsigned char* bitmaps[] =
  1193. {
  1194. Bitmap176x264_1, Bitmap176x264_2, Bitmap176x264_3, Bitmap176x264_4, Bitmap176x264_5
  1195. };
  1196. #else
  1197. const unsigned char* bitmaps[] =
  1198. {
  1199. Bitmap176x264_1, Bitmap176x264_2 //, Bitmap176x264_3, Bitmap176x264_4, Bitmap176x264_5
  1200. };
  1201. #endif
  1202. if ((display.epd2.WIDTH == 176) && (display.epd2.HEIGHT == 264) && !display.epd2.hasColor)
  1203. {
  1204. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1205. {
  1206. display.firstPage();
  1207. do
  1208. {
  1209. display.fillScreen(GxEPD_WHITE);
  1210. display.drawInvertedBitmap(0, 0, bitmaps[i], 176, 264, GxEPD_BLACK);
  1211. }
  1212. while (display.nextPage());
  1213. delay(2000);
  1214. }
  1215. }
  1216. }
  1217. #endif
  1218. #ifdef _GxBitmaps240x416_H_
  1219. void drawBitmaps240x416()
  1220. {
  1221. #if !defined(__AVR)
  1222. const unsigned char* bitmaps[] =
  1223. {
  1224. Bitmap240x416_1, Bitmap240x416_2, Bitmap240x416_3
  1225. };
  1226. #else
  1227. const unsigned char* bitmaps[] =
  1228. {
  1229. Bitmap240x460_1, Bitmap240x460_2, Bitmap240x460_3
  1230. };
  1231. #endif
  1232. if ((display.epd2.WIDTH == 240) && (display.epd2.HEIGHT == 416) && !display.epd2.hasColor)
  1233. {
  1234. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1235. {
  1236. display.firstPage();
  1237. do
  1238. {
  1239. display.fillScreen(GxEPD_WHITE);
  1240. display.drawInvertedBitmap(0, 0, bitmaps[i], 240, 416, GxEPD_BLACK);
  1241. }
  1242. while (display.nextPage());
  1243. delay(2000);
  1244. }
  1245. }
  1246. }
  1247. #endif
  1248. #ifdef _GxBitmaps400x300_H_
  1249. void drawBitmaps400x300()
  1250. {
  1251. #if !defined(__AVR)
  1252. const unsigned char* bitmaps[] =
  1253. {
  1254. Bitmap400x300_1, Bitmap400x300_2
  1255. };
  1256. #else
  1257. const unsigned char* bitmaps[] = {}; // not enough code space
  1258. #endif
  1259. if ((display.epd2.WIDTH == 400) && (display.epd2.HEIGHT == 300) && !display.epd2.hasColor)
  1260. {
  1261. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1262. {
  1263. display.firstPage();
  1264. do
  1265. {
  1266. display.fillScreen(GxEPD_WHITE);
  1267. display.drawInvertedBitmap(0, 0, bitmaps[i], 400, 300, GxEPD_BLACK);
  1268. }
  1269. while (display.nextPage());
  1270. delay(2000);
  1271. }
  1272. }
  1273. }
  1274. #endif
  1275. #ifdef _GxBitmaps640x384_H_
  1276. void drawBitmaps640x384()
  1277. {
  1278. #if !defined(__AVR)
  1279. const unsigned char* bitmaps[] =
  1280. {
  1281. Bitmap640x384_1, Bitmap640x384_2
  1282. };
  1283. #else
  1284. const unsigned char* bitmaps[] = {}; // not enough code space
  1285. #endif
  1286. if ((display.epd2.WIDTH == 640) && (display.epd2.HEIGHT == 384))
  1287. {
  1288. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1289. {
  1290. display.firstPage();
  1291. do
  1292. {
  1293. display.fillScreen(GxEPD_WHITE);
  1294. display.drawInvertedBitmap(0, 0, bitmaps[i], 640, 384, GxEPD_BLACK);
  1295. }
  1296. while (display.nextPage());
  1297. delay(2000);
  1298. }
  1299. }
  1300. }
  1301. #endif
  1302. #ifdef _GxBitmaps648x480_H_
  1303. void drawBitmaps648x480()
  1304. {
  1305. #if !defined(__AVR)
  1306. const unsigned char* bitmaps[] =
  1307. {
  1308. Bitmap648x480_1, Bitmap648x480_2, Bitmap648x480_3
  1309. };
  1310. #else
  1311. const unsigned char* bitmaps[] = {}; // not enough code space
  1312. #endif
  1313. if ((display.epd2.WIDTH == 648) && (display.epd2.HEIGHT == 480) && !display.epd2.hasColor)
  1314. {
  1315. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1316. {
  1317. display.firstPage();
  1318. do
  1319. {
  1320. display.fillScreen(GxEPD_WHITE);
  1321. display.drawBitmap(0, 0, bitmaps[i], 648, 480, GxEPD_BLACK);
  1322. }
  1323. while (display.nextPage());
  1324. delay(2000);
  1325. }
  1326. }
  1327. }
  1328. #endif
  1329. #ifdef _GxBitmaps800x480_H_
  1330. void drawBitmaps800x480()
  1331. {
  1332. #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI)
  1333. const unsigned char* bitmaps[] =
  1334. {
  1335. Bitmap800x480_3, Bitmap800x480_4
  1336. };
  1337. #elif !defined(__AVR)
  1338. const unsigned char* bitmaps[] =
  1339. {
  1340. Bitmap800x480_1, Bitmap800x480_2, Bitmap800x480_3, Bitmap800x480_4
  1341. };
  1342. #else
  1343. const unsigned char* bitmaps[] = {}; // not enough code space
  1344. #endif
  1345. if ((display.epd2.WIDTH == 800) && (display.epd2.HEIGHT == 480))
  1346. {
  1347. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1348. {
  1349. display.firstPage();
  1350. do
  1351. {
  1352. display.fillScreen(GxEPD_WHITE);
  1353. display.drawBitmap(0, 0, bitmaps[i], 800, 480, GxEPD_BLACK);
  1354. }
  1355. while (display.nextPage());
  1356. delay(2000);
  1357. }
  1358. if ((display.epd2.panel == GxEPD2::GDEW075T7) || (display.epd2.panel == GxEPD2::GDEY075T7))
  1359. {
  1360. // avoid ghosting caused by OTP waveform
  1361. display.clearScreen();
  1362. display.refresh(false); // full update
  1363. }
  1364. }
  1365. }
  1366. #endif
  1367. #if defined(ESP32) && defined(_GxBitmaps960x640_H_)
  1368. void drawBitmaps960x640()
  1369. {
  1370. if ((display.epd2.WIDTH == 960) && (display.epd2.HEIGHT == 640) && !display.epd2.hasColor)
  1371. {
  1372. display.drawImage(Bitmap960x640_1, 0, 0, 960, 640, false, true, true); delay(5000);
  1373. display.drawImage(Bitmap960x640_2, 0, 0, 960, 640, false, true, true); delay(5000);
  1374. display.drawImage(Bitmap960x640_3, 0, 0, 960, 640, false, true, true); delay(5000);
  1375. }
  1376. }
  1377. #endif
  1378. #if defined(ESP32) && defined(_GxBitmaps960x680_H_)
  1379. void drawBitmaps960x680()
  1380. {
  1381. if ((display.epd2.WIDTH == 960) && (display.epd2.HEIGHT == 680) && !display.epd2.hasColor)
  1382. {
  1383. display.drawImage(Bitmap960x680_1, 0, 0, 960, 680, false, true, true); delay(5000);
  1384. display.drawImage(Bitmap960x680_2, 0, 0, 960, 680, false, true, true); delay(5000);
  1385. }
  1386. }
  1387. #endif
  1388. #ifdef _WS_Bitmaps800x600_H_
  1389. void drawBitmaps800x600()
  1390. {
  1391. #if defined(ESP8266) || defined(ESP32)
  1392. if ((display.epd2.panel == GxEPD2::ED060SCT) || (display.epd2.panel == GxEPD2::ED060KC1) || (display.epd2.panel == GxEPD2::ED078KC2))
  1393. {
  1394. // Serial.print("sizeof(WS_zoo_800x600) is "); Serial.println(sizeof(WS_zoo_800x600));
  1395. display.drawNative(WS_zoo_800x600, 0, 0, 0, 800, 600, false, false, true);
  1396. delay(2000);
  1397. // Serial.print("sizeof(WS_pic_1200x825) is "); Serial.println(sizeof(WS_pic_1200x825));
  1398. // display.drawNative((const uint8_t*)WS_pic_1200x825, 0, 0, 0, 1200, 825, false, false, true);
  1399. // delay(2000);
  1400. // Serial.print("sizeof(WS_acaa_1024x731) is "); Serial.println(sizeof(WS_acaa_1024x731));
  1401. // display.drawNative(WS_acaa_1024x731, 0, 0, 0, 1024, 731, false, false, true);
  1402. // delay(2000);
  1403. }
  1404. #endif
  1405. }
  1406. #endif
  1407. #if defined(ESP32) && defined(_GxBitmaps1304x984_H_)
  1408. void drawBitmaps1304x984()
  1409. {
  1410. if (display.epd2.panel == GxEPD2::GDEW1248T3)
  1411. {
  1412. display.drawImage(Bitmap1304x984, 0, 0, display.epd2.WIDTH, display.epd2.HEIGHT, false, false, true);
  1413. }
  1414. }
  1415. #endif
  1416. struct bitmap_pair
  1417. {
  1418. const unsigned char* black;
  1419. const unsigned char* red;
  1420. };
  1421. #ifdef _GxBitmaps3c200x200_H_
  1422. void drawBitmaps3c200x200()
  1423. {
  1424. bitmap_pair bitmap_pairs[] =
  1425. {
  1426. //{Bitmap3c200x200_black, Bitmap3c200x200_red},
  1427. {WS_Bitmap3c200x200_black, WS_Bitmap3c200x200_red}
  1428. };
  1429. if (display.epd2.panel == GxEPD2::GDEW0154Z04)
  1430. {
  1431. display.firstPage();
  1432. do
  1433. {
  1434. display.fillScreen(GxEPD_WHITE);
  1435. // Bitmap3c200x200_black has 2 bits per pixel
  1436. // taken from Adafruit_GFX.cpp, modified
  1437. int16_t byteWidth = (display.epd2.WIDTH + 7) / 8; // Bitmap scanline pad = whole byte
  1438. uint8_t byte = 0;
  1439. for (int16_t j = 0; j < display.epd2.HEIGHT; j++)
  1440. {
  1441. for (int16_t i = 0; i < display.epd2.WIDTH; i++)
  1442. {
  1443. if (i & 3) byte <<= 2;
  1444. else
  1445. {
  1446. #if defined(__AVR) || defined(ESP8266) || defined(ESP32)
  1447. byte = pgm_read_byte(&Bitmap3c200x200_black[j * byteWidth * 2 + i / 4]);
  1448. #else
  1449. byte = Bitmap3c200x200_black[j * byteWidth * 2 + i / 4];
  1450. #endif
  1451. }
  1452. if (!(byte & 0x80))
  1453. {
  1454. display.drawPixel(i, j, GxEPD_BLACK);
  1455. }
  1456. }
  1457. }
  1458. display.drawInvertedBitmap(0, 0, Bitmap3c200x200_red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1459. }
  1460. while (display.nextPage());
  1461. delay(2000);
  1462. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1463. {
  1464. display.firstPage();
  1465. do
  1466. {
  1467. display.fillScreen(GxEPD_WHITE);
  1468. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1469. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1470. }
  1471. while (display.nextPage());
  1472. delay(2000);
  1473. }
  1474. }
  1475. if (display.epd2.hasColor)
  1476. {
  1477. display.clearScreen(); // use default for white
  1478. int16_t x = (int16_t(display.epd2.WIDTH) - 200) / 2;
  1479. int16_t y = (int16_t(display.epd2.HEIGHT) - 200) / 2;
  1480. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1481. {
  1482. display.drawImage(bitmap_pairs[i].black, bitmap_pairs[i].red, x, y, 200, 200, false, false, true);
  1483. delay(2000);
  1484. }
  1485. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1486. {
  1487. int16_t x = -60;
  1488. int16_t y = -60;
  1489. for (uint16_t j = 0; j < 10; j++)
  1490. {
  1491. display.writeScreenBuffer(); // use default for white
  1492. display.writeImage(bitmap_pairs[i].black, bitmap_pairs[i].red, x, y, 200, 200, false, false, true);
  1493. display.refresh();
  1494. delay(1000);
  1495. x += display.epd2.WIDTH / 4;
  1496. y += display.epd2.HEIGHT / 4;
  1497. if ((x >= int16_t(display.epd2.WIDTH)) || (y >= int16_t(display.epd2.HEIGHT))) break;
  1498. }
  1499. }
  1500. display.writeScreenBuffer(); // use default for white
  1501. display.writeImage(bitmap_pairs[0].black, bitmap_pairs[0].red, 0, 0, 200, 200, false, false, true);
  1502. display.writeImage(bitmap_pairs[0].black, bitmap_pairs[0].red, int16_t(display.epd2.WIDTH) - 200, int16_t(display.epd2.HEIGHT) - 200, 200, 200, false, false, true);
  1503. display.refresh();
  1504. delay(2000);
  1505. }
  1506. }
  1507. #endif
  1508. #ifdef _GxBitmaps3c104x212_H_
  1509. void drawBitmaps3c104x212()
  1510. {
  1511. #if !defined(__AVR)
  1512. bitmap_pair bitmap_pairs[] =
  1513. {
  1514. {Bitmap3c104x212_1_black, Bitmap3c104x212_1_red},
  1515. {Bitmap3c104x212_2_black, Bitmap3c104x212_2_red},
  1516. {WS_Bitmap3c104x212_black, WS_Bitmap3c104x212_red}
  1517. };
  1518. #else
  1519. bitmap_pair bitmap_pairs[] =
  1520. {
  1521. {Bitmap3c104x212_1_black, Bitmap3c104x212_1_red},
  1522. //{Bitmap3c104x212_2_black, Bitmap3c104x212_2_red},
  1523. {WS_Bitmap3c104x212_black, WS_Bitmap3c104x212_red}
  1524. };
  1525. #endif
  1526. if (display.epd2.panel == GxEPD2::GDEW0213Z16)
  1527. {
  1528. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1529. {
  1530. display.firstPage();
  1531. do
  1532. {
  1533. display.fillScreen(GxEPD_WHITE);
  1534. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1535. if (bitmap_pairs[i].red == WS_Bitmap3c104x212_red)
  1536. {
  1537. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1538. }
  1539. else display.drawBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1540. }
  1541. while (display.nextPage());
  1542. delay(2000);
  1543. }
  1544. }
  1545. }
  1546. #endif
  1547. #ifdef _GxBitmaps3c128x250_H_
  1548. void drawBitmaps3c128x250()
  1549. {
  1550. if ((display.epd2.WIDTH == 128) && (display.epd2.HEIGHT == 250) && display.epd2.hasColor)
  1551. {
  1552. bool mirrored = display.mirror(true);
  1553. display.firstPage();
  1554. do
  1555. {
  1556. display.fillScreen(GxEPD_WHITE);
  1557. display.drawInvertedBitmap(0, 0, Bitmap3c128x250_1_black, 128, 250, GxEPD_BLACK);
  1558. display.drawInvertedBitmap(0, 0, Bitmap3c128x250_1_red, 128, 250, GxEPD_RED);
  1559. }
  1560. while (display.nextPage());
  1561. delay(2000);
  1562. #if !defined(__AVR)
  1563. display.firstPage();
  1564. do
  1565. {
  1566. display.fillScreen(GxEPD_WHITE);
  1567. display.drawInvertedBitmap(0, 0, Bitmap3c128x250_2_black, 128, 250, GxEPD_BLACK);
  1568. display.drawBitmap(0, 0, Bitmap3c128x250_2_red, 128, 250, GxEPD_RED);
  1569. }
  1570. while (display.nextPage());
  1571. delay(2000);
  1572. #endif
  1573. display.mirror(mirrored);
  1574. }
  1575. }
  1576. #endif
  1577. #ifdef _GxBitmaps3c128x296_H_
  1578. void drawBitmaps3c128x296()
  1579. {
  1580. #if !defined(__AVR)
  1581. bitmap_pair bitmap_pairs[] =
  1582. {
  1583. {Bitmap3c128x296_1_black, Bitmap3c128x296_1_red},
  1584. {Bitmap3c128x296_2_black, Bitmap3c128x296_2_red},
  1585. {WS_Bitmap3c128x296_black, WS_Bitmap3c128x296_red}
  1586. };
  1587. #else
  1588. bitmap_pair bitmap_pairs[] =
  1589. {
  1590. //{Bitmap3c128x296_1_black, Bitmap3c128x296_1_red},
  1591. //{Bitmap3c128x296_2_black, Bitmap3c128x296_2_red},
  1592. {WS_Bitmap3c128x296_black, WS_Bitmap3c128x296_red}
  1593. };
  1594. #endif
  1595. if ((display.epd2.WIDTH == 128) && (display.epd2.HEIGHT == 296) && display.epd2.hasColor)
  1596. {
  1597. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1598. {
  1599. display.firstPage();
  1600. do
  1601. {
  1602. display.fillScreen(GxEPD_WHITE);
  1603. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, 128, 296, GxEPD_BLACK);
  1604. if (bitmap_pairs[i].red == WS_Bitmap3c128x296_red)
  1605. {
  1606. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, 128, 296, GxEPD_RED);
  1607. }
  1608. else display.drawBitmap(0, 0, bitmap_pairs[i].red, 128, 296, GxEPD_RED);
  1609. }
  1610. while (display.nextPage());
  1611. delay(2000);
  1612. }
  1613. }
  1614. }
  1615. #endif
  1616. #ifdef _GxBitmaps3c152x296_H_
  1617. void drawBitmaps3c152x296()
  1618. {
  1619. bitmap_pair bitmap_pairs[] =
  1620. {
  1621. {Bitmap3c152x296_black, Bitmap3c152x296_red}
  1622. };
  1623. if (display.epd2.panel == GxEPD2::GDEY0266Z90)
  1624. {
  1625. bool mirrored = display.mirror(true);
  1626. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1627. {
  1628. display.firstPage();
  1629. do
  1630. {
  1631. display.fillScreen(GxEPD_WHITE);
  1632. display.drawBitmap(0, 0, bitmap_pairs[i].black, 152, 296, GxEPD_BLACK);
  1633. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, 152, 296, GxEPD_RED);
  1634. }
  1635. while (display.nextPage());
  1636. delay(2000);
  1637. }
  1638. display.mirror(mirrored);
  1639. }
  1640. }
  1641. #endif
  1642. #ifdef _GxBitmaps3c176x264_H_
  1643. void drawBitmaps3c176x264()
  1644. {
  1645. bitmap_pair bitmap_pairs[] =
  1646. {
  1647. {Bitmap3c176x264_black, Bitmap3c176x264_red}
  1648. };
  1649. if (display.epd2.panel == GxEPD2::GDEW027C44)
  1650. {
  1651. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1652. {
  1653. display.firstPage();
  1654. do
  1655. {
  1656. display.fillScreen(GxEPD_WHITE);
  1657. display.drawBitmap(0, 0, bitmap_pairs[i].black, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1658. display.drawBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1659. }
  1660. while (display.nextPage());
  1661. delay(2000);
  1662. }
  1663. }
  1664. }
  1665. #endif
  1666. #ifdef _GxBitmaps3c400x300_H_
  1667. void drawBitmaps3c400x300()
  1668. {
  1669. #if !defined(__AVR)
  1670. bitmap_pair bitmap_pairs[] =
  1671. {
  1672. {Bitmap3c400x300_1_black, Bitmap3c400x300_1_red},
  1673. {Bitmap3c400x300_2_black, Bitmap3c400x300_2_red},
  1674. {WS_Bitmap3c400x300_black, WS_Bitmap3c400x300_red}
  1675. };
  1676. #else
  1677. bitmap_pair bitmap_pairs[] = {}; // not enough code space
  1678. #endif
  1679. if (display.epd2.panel == GxEPD2::GDEW042Z15)
  1680. {
  1681. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1682. {
  1683. display.firstPage();
  1684. do
  1685. {
  1686. display.fillScreen(GxEPD_WHITE);
  1687. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1688. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1689. }
  1690. while (display.nextPage());
  1691. delay(2000);
  1692. }
  1693. }
  1694. }
  1695. #endif
  1696. #ifdef _GxBitmaps3c648x480_H_
  1697. void drawBitmaps3c648x480()
  1698. {
  1699. #if !defined(__AVR)
  1700. bitmap_pair bitmap_pairs[] =
  1701. {
  1702. {Bitmap3c648x480_black, Bitmap3c648x480_red},
  1703. {Bitmap3c648x480_black_2, Bitmap3c648x480_red_2}
  1704. };
  1705. #else
  1706. bitmap_pair bitmap_pairs[] = {}; // not enough code space
  1707. #endif
  1708. if ((display.epd2.panel == GxEPD2::GDEW0583Z83) || (display.epd2.panel == GxEPD2::GDEQ0583Z31))
  1709. {
  1710. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1711. {
  1712. display.firstPage();
  1713. do
  1714. {
  1715. display.fillScreen(GxEPD_WHITE);
  1716. display.drawBitmap(0, 0, bitmap_pairs[i].black, 648, 480, GxEPD_BLACK);
  1717. display.drawBitmap(0, 0, bitmap_pairs[i].red, 648, 480, GxEPD_RED);
  1718. }
  1719. while (display.nextPage());
  1720. delay(2000);
  1721. }
  1722. }
  1723. }
  1724. #endif
  1725. #ifdef _GxBitmaps3c800x480_H_
  1726. void drawBitmaps3c800x480()
  1727. {
  1728. #if !defined(__AVR)
  1729. bitmap_pair bitmap_pairs[] =
  1730. {
  1731. {Bitmap3c800x480_1_black, Bitmap3c800x480_1_red}
  1732. };
  1733. #else
  1734. bitmap_pair bitmap_pairs[] = {}; // not enough code space
  1735. #endif
  1736. if (display.epd2.panel == GxEPD2::GDEW075Z08)
  1737. {
  1738. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1739. {
  1740. display.firstPage();
  1741. do
  1742. {
  1743. display.fillScreen(GxEPD_WHITE);
  1744. display.drawBitmap(0, 0, bitmap_pairs[i].black, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1745. display.drawBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1746. }
  1747. while (display.nextPage());
  1748. delay(2000);
  1749. }
  1750. }
  1751. }
  1752. #endif
  1753. #ifdef _GxBitmaps3c880x528_H_
  1754. void drawBitmaps3c880x528()
  1755. {
  1756. #if !defined(__AVR)
  1757. bitmap_pair bitmap_pairs[] =
  1758. {
  1759. {Bitmap3c880x528_black, Bitmap3c880x528_red}
  1760. };
  1761. #else
  1762. bitmap_pair bitmap_pairs[] = {}; // not enough code space
  1763. #endif
  1764. if (display.epd2.panel == GxEPD2::GDEH075Z90)
  1765. {
  1766. bool m = display.mirror(true);
  1767. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1768. {
  1769. display.firstPage();
  1770. do
  1771. {
  1772. display.fillScreen(GxEPD_WHITE);
  1773. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, 880, 528, GxEPD_BLACK);
  1774. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, 880, 528, GxEPD_RED);
  1775. }
  1776. while (display.nextPage());
  1777. delay(2000);
  1778. }
  1779. display.mirror(m);
  1780. }
  1781. }
  1782. #endif
  1783. #if defined(ESP32) && defined(_GxBitmaps3c960x640_H_)
  1784. void drawBitmaps3c960x640()
  1785. {
  1786. if ((display.epd2.WIDTH == 960) && (display.epd2.HEIGHT == 640) && display.epd2.hasColor)
  1787. {
  1788. display.drawImage(Bitmap3c960x640_black, Bitmap3c960x640_red, 0, 0, 960, 640, false, false, true);
  1789. delay(2000);
  1790. }
  1791. }
  1792. #endif
  1793. #if defined(ESP32) && defined(_GxBitmaps3c960x680_H_)
  1794. void drawBitmaps3c960x680()
  1795. {
  1796. if ((display.epd2.WIDTH == 960) && (display.epd2.HEIGHT == 680) && display.epd2.hasColor)
  1797. {
  1798. display.drawImage(Bitmap3c960x680_black, Bitmap3c960x680_red, 0, 0, 960, 680, false, true, true);
  1799. }
  1800. delay(2000);
  1801. }
  1802. #endif
  1803. #if defined(ESP32) && defined(_GxBitmaps3c1304x984_H_)
  1804. void drawBitmaps3c1304x984()
  1805. {
  1806. if (display.epd2.panel == GxEPD2::GDEY1248Z51)
  1807. {
  1808. //display.drawImage(Bitmap3c1304x984_black, Bitmap3c1304x984_red, 0, 0, 1304, 984, false, false, true);
  1809. display.writeImage(0, Bitmap3c1304x984_red, 0, 0, 1304, 984, true, false, true); // red bitmap is inverted
  1810. display.drawImage(Bitmap3c1304x984_black, 0, 0, 0, 1304, 984, true, false, true); // black bitmap is normal
  1811. }
  1812. }
  1813. #endif
  1814. #if defined(_GxBitmaps4c128x250_H_)
  1815. void drawBitmaps4c128x250()
  1816. {
  1817. if (display.epd2.panel == GxEPD2::GDEY0213F51)
  1818. {
  1819. display.drawNative(Bitmap4c128x250, 0, 0, 0, 128, 250, false, false, true);
  1820. delay(5000);
  1821. }
  1822. }
  1823. #endif
  1824. #if defined(_WS_Bitmaps4c168x168_H_)
  1825. void drawBitmaps4c168x168()
  1826. {
  1827. if ((display.epd2.panel == GxEPD2::Waveshare437inch4color) || (display.epd2.panel == GxEPD2::Waveshare3inch4color))
  1828. {
  1829. display.drawNative(WS_Bitmap4c168x168, 0, (display.epd2.WIDTH - 168) / 2, (display.epd2.HEIGHT - 168) / 2, 168, 168, false, false, true);
  1830. delay(5000);
  1831. }
  1832. }
  1833. #endif
  1834. #if defined(_WS_Bitmaps4c168x400_H_)
  1835. void drawBitmaps4c168x400()
  1836. {
  1837. if (display.epd2.panel == GxEPD2::Waveshare3inch4color)
  1838. {
  1839. display.drawNative(WS_Bitmap4c168x400, 0, (display.epd2.WIDTH - 168) / 2, (display.epd2.HEIGHT - 400) / 2, 168, 400, false, false, true);
  1840. delay(5000);
  1841. }
  1842. }
  1843. #endif
  1844. #if defined(_GxBitmaps4c168x384_H_)
  1845. void drawBitmaps4c168x384()
  1846. {
  1847. if (display.epd2.panel == GxEPD2::GDEY029F51H)
  1848. {
  1849. display.drawNative(Bitmap4c168x384, 0, (display.epd2.WIDTH - 168) / 2, (display.epd2.HEIGHT - 384) / 2, 168, 384, false, false, true);
  1850. delay(5000);
  1851. }
  1852. }
  1853. #endif
  1854. #if defined(_GxBitmaps4c184x360_H_)
  1855. void drawBitmaps4c184x360()
  1856. {
  1857. if (display.epd2.panel == GxEPD2::GDEY0266F51H)
  1858. {
  1859. display.drawNative(Bitmap4c184x360, 0, (display.epd2.WIDTH - 184) / 2, (display.epd2.HEIGHT - 360) / 2, 184, 360, false, false, true);
  1860. delay(5000);
  1861. }
  1862. }
  1863. #endif
  1864. #if defined(_GxBitmaps4c400x300_H_)
  1865. void drawBitmaps4c400x300()
  1866. {
  1867. if (display.epd2.panel == GxEPD2::GDEY0420F51)
  1868. {
  1869. display.drawNative(Bitmap4c400x300, 0, (display.epd2.WIDTH - 400) / 2, (display.epd2.HEIGHT - 300) / 2, 400, 300, false, false, true);
  1870. delay(5000);
  1871. }
  1872. }
  1873. #endif
  1874. #if defined(_WS_Bitmaps7c192x143_H_)
  1875. void drawBitmaps7c192x143()
  1876. {
  1877. if (display.epd2.panel == GxEPD2::ACeP565)
  1878. {
  1879. display.drawNative(WS_Bitmap7c192x143, 0, (display.epd2.WIDTH - 192) / 2, (display.epd2.HEIGHT - 143) / 2, 192, 143, false, false, true);
  1880. delay(5000);
  1881. }
  1882. }
  1883. #endif
  1884. #if defined(_GxBitmaps7c800x480_H_)
  1885. void drawBitmaps7c800x480()
  1886. {
  1887. if ((display.epd2.panel == GxEPD2::GDEY073D46) || (display.epd2.panel == GxEPD2::ACeP730))
  1888. {
  1889. display.epd2.drawDemoBitmap(Bitmap7c800x480, 0, 0, 0, 800, 480, 0, false, true); // special format
  1890. delay(5000);
  1891. }
  1892. }
  1893. #endif
  1894. #if defined(_WS_Bitmaps7c300x180_H_)
  1895. void drawBitmaps7c300x180()
  1896. {
  1897. if ((display.epd2.panel == GxEPD2::GDEY073D46) || (display.epd2.panel == GxEPD2::ACeP730))
  1898. {
  1899. display.drawNative(WS_Bitmap7c300x180, 0, (display.epd2.WIDTH - 300) / 2, (display.epd2.HEIGHT - 180) / 2, 300, 180, false, false, true);
  1900. delay(5000);
  1901. }
  1902. }
  1903. #endif
  1904. void draw7colors()
  1905. {
  1906. display.setRotation(0);
  1907. uint16_t h = display.height() / 7;
  1908. display.firstPage();
  1909. do
  1910. {
  1911. display.fillRect(0, 0, display.width(), h, GxEPD_BLACK);
  1912. display.fillRect(0, h, display.width(), h, GxEPD_WHITE);
  1913. display.fillRect(0, 2 * h, display.width(), h, GxEPD_GREEN);
  1914. display.fillRect(0, 3 * h, display.width(), h, GxEPD_BLUE);
  1915. display.fillRect(0, 4 * h, display.width(), h, GxEPD_RED);
  1916. display.fillRect(0, 5 * h, display.width(), h, GxEPD_YELLOW);
  1917. display.fillRect(0, 6 * h, display.width(), h, GxEPD_ORANGE);
  1918. }
  1919. while (display.nextPage());
  1920. }
  1921. void draw7colorlines()
  1922. {
  1923. display.setRotation(0);
  1924. uint16_t h = 2;
  1925. display.firstPage();
  1926. do
  1927. {
  1928. uint16_t y = 0;
  1929. do
  1930. {
  1931. display.fillRect(0, y, display.width(), h, GxEPD_BLACK); y += h;
  1932. display.fillRect(0, y, display.width(), h, GxEPD_WHITE); y += h;
  1933. display.fillRect(0, y, display.width(), h, GxEPD_GREEN); y += h;
  1934. display.fillRect(0, y, display.width(), h, GxEPD_WHITE); y += h;
  1935. display.fillRect(0, y, display.width(), h, GxEPD_BLUE); y += h;
  1936. display.fillRect(0, y, display.width(), h, GxEPD_WHITE); y += h;
  1937. display.fillRect(0, y, display.width(), h, GxEPD_RED); y += h;
  1938. display.fillRect(0, y, display.width(), h, GxEPD_WHITE); y += h;
  1939. display.fillRect(0, y, display.width(), h, GxEPD_YELLOW); y += h;
  1940. display.fillRect(0, y, display.width(), h, GxEPD_WHITE); y += h;
  1941. display.fillRect(0, y, display.width(), h, GxEPD_ORANGE); y += h;
  1942. display.fillRect(0, y, display.width(), h, GxEPD_WHITE); y += h;
  1943. }
  1944. while ((y + 12 * h) < uint16_t(display.height()));
  1945. //display.drawPixel(0, y, GxEPD_BLACK); display.drawPixel(10, y, GxEPD_GREEN);
  1946. //display.drawPixel(20, y, GxEPD_BLUE); display.drawPixel(30, y, GxEPD_RED);
  1947. //display.drawPixel(40, y, GxEPD_YELLOW); display.drawPixel(50, y, GxEPD_ORANGE);
  1948. display.fillRect(0, y, 2, 2, GxEPD_BLACK); display.fillRect(10, y, 2, 2, GxEPD_GREEN);
  1949. display.fillRect(20, y, 2, 2, GxEPD_BLUE); display.fillRect(30, y, 2, 2, GxEPD_RED);
  1950. display.fillRect(40, y, 2, 2, GxEPD_YELLOW); display.fillRect(50, y, 2, 2, GxEPD_ORANGE);
  1951. }
  1952. while (display.nextPage());
  1953. }
  1954. void drawGraphics()
  1955. {
  1956. display.setRotation(0);
  1957. display.firstPage();
  1958. do
  1959. {
  1960. display.drawRect(display.width() / 8, display.height() / 8, display.width() * 3 / 4, display.height() * 3 / 4, GxEPD_BLACK);
  1961. display.drawLine(display.width() / 8, display.height() / 8, display.width() * 7 / 8, display.height() * 7 / 8, GxEPD_BLACK);
  1962. display.drawLine(display.width() / 8, display.height() * 7 / 8, display.width() * 7 / 8, display.height() / 8, GxEPD_BLACK);
  1963. display.drawCircle(display.width() / 2, display.height() / 2, display.height() / 4, GxEPD_BLACK);
  1964. display.drawPixel(display.width() / 4, display.height() / 2 , GxEPD_BLACK);
  1965. display.drawPixel(display.width() * 3 / 4, display.height() / 2 , GxEPD_BLACK);
  1966. }
  1967. while (display.nextPage());
  1968. }