参考网址:

一个例子:

支持厂商-微雪

器件:

代码

  1. // by LingShunLAB.com
  2. // refer:GxEPD2 library
  3. #define ENABLE_GxEPD2_GFX 0
  4. #include <GxEPD2_BW.h> // 加载 两色屏幕 GxEPD2 库
  5. #include <Adafruit_GFX.h> // 加载 Adafruit_GFX 库
  6. // 注意,以下定义适配 微雪2.9寸三色(黑白红)电子墨水屏在 Arduino Uno 使用
  7. // 更多其他开发板,电子墨水屏的定义请查看GxEPD2库的例子
  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_290_T94_V2, MAX_HEIGHT(GxEPD2_290_T94_V2)> display(GxEPD2_290_T94_V2(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7));
  11. // Include fonts from Adafruit_GFX
  12. #include <Fonts/FreeMono9pt7b.h>
  13. #include <Fonts/FreeMono12pt7b.h>
  14. #include <Fonts/FreeMono18pt7b.h>
  15. #include <Fonts/FreeMono24pt7b.h>
  16. #include <Fonts/FreeMonoBold9pt7b.h>
  17. #include <Fonts/FreeMonoBold12pt7b.h>
  18. #include <Fonts/FreeMonoBold18pt7b.h>
  19. #include <Fonts/FreeMonoBold24pt7b.h>
  20. // 图像logo_1 取模数据
  21. // 大小:300 x 86 像素
  22. // 复制取模数据后,需要添加 PROGMEM 修饰符,表示变量存储在闪存
  23. const unsigned char gImage_2[1806] PROGMEM = { /*0X00,0X01,0X78,0X00,0X78,0X00,*/
  24. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
  25. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
  26. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
  27. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
  28. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
  29. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0XFF,0XFF,0XC7,0X1F,0XE0,
  30. 0X71,0XC7,0XE0,0X7E,0X7E,0X07,0XFF,0XFF,0XC0,0X07,0XFF,0XFF,0XC7,0X1F,0XE0,0X71,
  31. 0XC7,0XE0,0X7E,0X7E,0X07,0XFF,0XFF,0XC0,0X07,0XFF,0XFF,0XC7,0X1F,0XE0,0X71,0XC7,
  32. 0XE0,0X7E,0X7E,0X07,0XFF,0XFF,0XC0,0X07,0X00,0X01,0XC0,0XFC,0XFC,0X70,0X00,0X03,
  33. 0XFE,0X0F,0XC7,0X00,0X01,0XC0,0X07,0X00,0X01,0XC0,0XFC,0X7C,0X70,0X00,0X03,0XFE,
  34. 0X0F,0XC7,0X00,0X01,0XC0,0X07,0X00,0X01,0XC0,0XFC,0XFC,0X70,0X00,0X03,0XFE,0X0F,
  35. 0XC7,0X00,0X01,0XC0,0X07,0X1F,0XF1,0XC0,0X03,0XE0,0X00,0X38,0X1F,0X80,0X0F,0XC7,
  36. 0X1F,0XF1,0XC0,0X07,0X1F,0XF1,0XC0,0X03,0XE0,0X00,0X38,0X1F,0X80,0X0F,0XC7,0X1F,
  37. 0XF1,0XC0,0X07,0X1F,0XF1,0XC0,0X03,0XE0,0X00,0X38,0X1F,0X80,0X0F,0XC7,0X1F,0XF1,
  38. 0XC0,0X07,0X1F,0XF1,0XC7,0XFF,0XE0,0X7E,0X07,0X1F,0X80,0X0E,0X07,0X1F,0XF1,0XC0,
  39. 0X07,0X1F,0XF1,0XC7,0XFF,0XE0,0X7E,0X07,0X1F,0X80,0X0E,0X07,0X1F,0XF1,0XC0,0X07,
  40. 0X1F,0XF1,0XC7,0XFF,0XE0,0X7E,0X07,0X1F,0X80,0X0E,0X07,0X1F,0XF1,0XC0,0X07,0X1F,
  41. 0XF1,0XC0,0XE0,0XFF,0XFE,0X38,0X1C,0X00,0X0F,0XC7,0X1F,0XF1,0XC0,0X07,0X1F,0XF1,
  42. 0XC0,0XE0,0XFF,0XFE,0X38,0X1C,0X00,0X0F,0XC7,0X1F,0XF1,0XC0,0X07,0X1F,0XF1,0XC0,
  43. 0XE0,0XFF,0XFE,0X38,0X1C,0X00,0X0F,0XC7,0X1F,0XF1,0XC0,0X07,0X00,0X01,0XC0,0X03,
  44. 0XFC,0X01,0XC7,0XFC,0X73,0XFF,0XC7,0X00,0X01,0XC0,0X07,0X00,0X01,0XC0,0X03,0XFC,
  45. 0X01,0XC7,0XFC,0X73,0XFF,0XC7,0X00,0X01,0XC0,0X07,0X80,0X01,0XC0,0X03,0XFC,0X01,
  46. 0XC7,0XFC,0X73,0XFF,0XC7,0X00,0X03,0XC0,0X07,0XFF,0XFF,0XC7,0X1C,0XE3,0X8E,0X38,
  47. 0XE3,0X8E,0X71,0XC7,0XFF,0XFF,0XC0,0X07,0XFF,0XFF,0XC7,0X1C,0XE3,0X8E,0X38,0XE3,
  48. 0X8E,0X71,0XC7,0XFF,0XFF,0XC0,0X03,0XFF,0XFF,0XC7,0X1C,0XE3,0X8E,0X38,0XE3,0X8E,
  49. 0X71,0XC7,0XFF,0XFF,0X80,0X00,0X00,0X00,0X00,0X03,0X83,0XF0,0X38,0X1C,0X71,0X81,
  50. 0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X83,0XF0,0X38,0X1C,0X73,0X81,0XC0,
  51. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0X03,0XF0,0X38,0X1C,0X61,0XC1,0XC0,0X00,
  52. 0X00,0X00,0X00,0X1C,0X7F,0XC7,0X1F,0X9F,0X8E,0X38,0XFF,0X81,0XFE,0X38,0X03,0X81,
  53. 0XC0,0X00,0X1C,0X7F,0XC7,0X1F,0X1F,0X8E,0X38,0XFF,0X83,0XFE,0X38,0X03,0X81,0XC0,
  54. 0X00,0X0C,0X7F,0XCF,0X3F,0X9F,0X8E,0X3D,0XFF,0X81,0XFE,0X38,0X03,0X0B,0X80,0X00,
  55. 0X00,0X70,0X38,0XE3,0XFC,0X0E,0X3F,0XE3,0X80,0X71,0XC0,0X00,0X0E,0X00,0X00,0X00,
  56. 0X70,0X38,0XE3,0XFC,0X0E,0X3F,0XE3,0X80,0X71,0XC0,0X00,0X0E,0X00,0X00,0X01,0XFF,
  57. 0XE0,0XE3,0X9C,0X03,0XFF,0X1C,0X61,0X50,0XC7,0XE3,0X0F,0X80,0X00,0X03,0X8F,0XC0,
  58. 0XE3,0X9C,0X01,0XF8,0X1C,0X71,0X80,0X07,0XE3,0X8F,0XC0,0X00,0X03,0X8F,0XC0,0XE3,
  59. 0X9C,0X01,0XF8,0X1C,0X73,0X80,0X07,0XE3,0X8F,0XC0,0X00,0X00,0X00,0X38,0X03,0X9C,
  60. 0X3F,0XF8,0X1F,0X83,0XFE,0X38,0X1C,0X00,0X00,0X00,0X00,0X00,0X38,0X03,0X9C,0X7F,
  61. 0XF8,0X1F,0X83,0XFE,0X38,0X1C,0X00,0X00,0X00,0X00,0X00,0X38,0X03,0X9C,0X7F,0XF8,
  62. 0X1F,0X83,0XFE,0X38,0X1C,0X00,0X00,0X03,0XFC,0X71,0XC0,0XC0,0X1F,0X8E,0X3F,0X1F,
  63. 0XE1,0XCE,0X3F,0XFC,0X0C,0X00,0X07,0XFC,0X71,0XC0,0XE0,0X1F,0X8E,0X3F,0X1F,0XF3,
  64. 0X8E,0X3F,0XFC,0X0E,0X00,0X07,0XFC,0X71,0XC0,0XE0,0X1F,0X8E,0X3F,0X1F,0XF3,0X8E,
  65. 0X3F,0XFC,0X0E,0X00,0X07,0XFF,0X8E,0X3F,0X1F,0X1E,0X7E,0X00,0X00,0X0E,0X70,0X07,
  66. 0X03,0XFF,0X80,0X07,0XFF,0X8E,0X3F,0X1F,0X9C,0X7E,0X00,0X00,0X0E,0X70,0X07,0X03,
  67. 0XFF,0XC0,0X07,0XFF,0X8E,0X3F,0X1F,0X9C,0X00,0X00,0X00,0X0E,0X70,0X07,0X03,0XFF,
  68. 0XC0,0X07,0X83,0XFF,0XF8,0X1F,0X9C,0X00,0X00,0X00,0X73,0XC1,0XC7,0X1C,0X7F,0XC0,
  69. 0X07,0X03,0XFF,0XF8,0X1F,0X1C,0X00,0X00,0X00,0X73,0X81,0XC7,0X1C,0X7F,0XC0,0X07,
  70. 0X03,0XFF,0XF8,0X1F,0X18,0X00,0X00,0X00,0X31,0X81,0XC7,0X1C,0X7F,0XC0,0X00,0X03,
  71. 0X8E,0X38,0X03,0XF8,0X00,0X00,0XC0,0X3F,0XFF,0XC0,0XE0,0X01,0XC0,0X00,0X03,0X8E,
  72. 0X38,0X03,0XF8,0X01,0XF2,0X40,0X3F,0XFF,0XC0,0XE0,0X01,0XC0,0X00,0X03,0X8E,0X38,
  73. 0X03,0XF8,0X02,0X00,0X00,0X3F,0XFF,0XC0,0XE0,0X01,0XC0,0X00,0X1F,0XF1,0XC7,0XFC,
  74. 0XF0,0X00,0X00,0X00,0X3F,0XC1,0XFF,0X03,0X8F,0XC0,0X00,0X1F,0XF1,0XC7,0XFC,0XE0,
  75. 0X0E,0X00,0X00,0X3F,0X81,0XFF,0X03,0X8F,0XC0,0X00,0X1F,0XF1,0XC7,0XFC,0XE0,0X0E,
  76. 0XFF,0XC0,0X3F,0X81,0XFF,0X03,0X8F,0XC0,0X07,0X1F,0XFE,0X38,0X03,0X80,0X0E,0XF8,
  77. 0X00,0X0F,0X81,0XC7,0X00,0X0F,0XC0,0X07,0X1F,0XFE,0X38,0X03,0X80,0X00,0X78,0X00,
  78. 0X0F,0X81,0XC7,0X00,0X0F,0XC0,0X07,0X1F,0XFE,0X38,0X03,0X80,0X00,0X38,0X00,0X0F,
  79. 0X81,0XC7,0X00,0X0F,0XC0,0X07,0XE3,0X81,0XFF,0XE3,0XF8,0X00,0X10,0X00,0X33,0X81,
  80. 0XFF,0X1F,0XFF,0XC0,0X07,0XE3,0X81,0XFF,0XE3,0XF8,0X03,0X00,0XE0,0X33,0X81,0XFF,
  81. 0X1F,0XFF,0XC0,0X07,0XE3,0X81,0XFF,0XE3,0XF8,0X3F,0X01,0XF8,0X31,0X81,0XFF,0X1F,
  82. 0XFF,0XC0,0X07,0X03,0X80,0X07,0XE3,0XE0,0X00,0X00,0X00,0X33,0X81,0XF8,0XFC,0X0E,
  83. 0X00,0X07,0X03,0X80,0X07,0XE3,0XE0,0X00,0X00,0X00,0X33,0X81,0XF8,0XFC,0X0E,0X00,
  84. 0X07,0X03,0X80,0X07,0XE3,0XE0,0X00,0XFE,0X00,0X33,0X81,0XF8,0XFC,0X0E,0X00,0X07,
  85. 0XFF,0XFF,0XFF,0X1C,0X60,0X00,0XDE,0X00,0X3F,0X8F,0XFF,0XE0,0X0E,0X00,0X07,0XFF,
  86. 0XFF,0XFF,0X1C,0XE0,0X00,0XBE,0X00,0X3F,0X8F,0XFF,0XE0,0X0E,0X00,0X07,0XFF,0XFF,
  87. 0XFF,0X1C,0XF0,0X00,0XBE,0X00,0X3F,0X8F,0XFF,0XE0,0X0E,0X00,0X07,0XFC,0X70,0X07,
  88. 0XE0,0XF8,0X00,0XFE,0X00,0X31,0X80,0X38,0X03,0XF1,0XC0,0X07,0XFC,0X70,0X07,0XE0,
  89. 0XF8,0X00,0XFE,0X00,0X31,0X80,0X38,0X03,0XF1,0XC0,0X07,0XFC,0X70,0X07,0XE0,0XF8,
  90. 0X00,0XFE,0X04,0X33,0X80,0X38,0X03,0XF1,0XC0,0X07,0XFF,0X8F,0XF8,0XFC,0XE0,0X1F,
  91. 0XFF,0XF0,0X3F,0X81,0XC7,0X1C,0X01,0XC0,0X07,0XFF,0X8F,0XF8,0XFC,0XE0,0X00,0X7F,
  92. 0X80,0X7F,0X81,0XC7,0X1C,0X01,0XC0,0X07,0XFF,0X8F,0XF8,0XFC,0XE0,0X00,0X00,0X00,
  93. 0X7F,0XC1,0XC7,0X1C,0X01,0X80,0X07,0XFC,0X7E,0X00,0X1F,0X83,0X00,0X00,0X00,0X01,
  94. 0XF0,0X00,0X03,0X8E,0X00,0X07,0XFC,0X7E,0X00,0X1F,0X03,0X80,0X38,0XFC,0X03,0XF0,
  95. 0X00,0X03,0X8E,0X00,0X07,0XFC,0X7E,0X00,0X1F,0X03,0XC0,0X38,0XFC,0X03,0XF0,0X00,
  96. 0X03,0X8E,0X00,0X07,0X1C,0X71,0XC0,0XE0,0X1F,0XFF,0XFF,0X03,0X8E,0X0E,0X3F,0X03,
  97. 0X81,0XC0,0X07,0X1C,0X71,0XC0,0XE0,0X1F,0XFF,0XFF,0X03,0X8E,0X0E,0X3F,0X03,0X81,
  98. 0XC0,0X03,0X1C,0X71,0XC1,0XE0,0X1F,0XFF,0XFF,0X03,0X9E,0X0E,0X3F,0X03,0X83,0X80,
  99. 0X00,0XFC,0X70,0X3F,0XFC,0XE3,0XF0,0X00,0X1C,0X71,0XF1,0XC0,0X03,0X8E,0X00,0X00,
  100. 0XFC,0X70,0X3F,0XFC,0XE3,0XF0,0X00,0X1C,0X73,0XF1,0XC0,0X03,0X8E,0X00,0X03,0XF4,
  101. 0X7F,0XFF,0X18,0XE3,0XDF,0XFF,0XFF,0XE1,0XE0,0XC3,0X03,0X0F,0X80,0X07,0X00,0X0F,
  102. 0XC0,0X00,0XE3,0X8F,0XFF,0XFF,0X80,0X00,0X07,0X00,0X0F,0XC0,0X07,0X00,0X0F,0XC0,
  103. 0X00,0XE3,0X8F,0XFF,0XFF,0X80,0X00,0X07,0X00,0X0F,0XC0,0X00,0XFC,0X00,0X3F,0X1F,
  104. 0XFF,0X81,0XF8,0XE7,0X8F,0XFE,0X07,0X00,0X03,0XC0,0X00,0XFC,0X00,0X3F,0X1F,0XFF,
  105. 0X81,0XF8,0XE3,0X8F,0XFE,0X07,0X00,0X01,0XC0,0X00,0XFC,0X00,0X3F,0X1F,0XFF,0X81,
  106. 0XF8,0XE3,0X8F,0XFE,0X07,0X00,0X01,0XC0,0X03,0X9C,0X7F,0XF8,0XFC,0X00,0X00,0X07,
  107. 0XE3,0X83,0XFF,0XFF,0XFC,0X7E,0X00,0X07,0X1C,0X7F,0XF8,0XFC,0X00,0X00,0X07,0XE3,
  108. 0X83,0XFF,0XFF,0XFC,0X7E,0X00,0X07,0X1C,0X7F,0XF8,0XFC,0X00,0X00,0X07,0XE3,0X81,
  109. 0XFF,0XFF,0XFC,0X7E,0X00,0X00,0X00,0X00,0X07,0XFC,0X7C,0X7F,0XC0,0XE0,0X0E,0X0F,
  110. 0XC0,0X1C,0X01,0X80,0X00,0X00,0X00,0X07,0XFC,0XFC,0X7F,0XC0,0XE0,0X0E,0X0F,0XC0,
  111. 0X1C,0X01,0XC0,0X00,0X00,0X00,0X07,0XFC,0XFC,0X7F,0XC0,0XE0,0X0E,0X0F,0XC0,0X1C,
  112. 0X01,0XC0,0X07,0XFF,0XFF,0XC0,0XE0,0XFF,0X81,0XFF,0XE0,0X00,0X0F,0XC7,0X1C,0X7F,
  113. 0XC0,0X07,0XFF,0XFF,0XC0,0XE0,0XFF,0X81,0XFF,0XE0,0X00,0X0F,0XC7,0X1C,0X7F,0XC0,
  114. 0X07,0XFF,0XFF,0XC0,0XE0,0X7F,0X81,0XFF,0XE0,0X00,0X0F,0XC7,0X1C,0X7F,0XC0,0X07,
  115. 0X00,0X01,0XC7,0XE3,0XF3,0XF0,0X00,0XE0,0X7F,0XF1,0XC0,0X1C,0X0F,0XC0,0X07,0X00,
  116. 0X01,0XC7,0XE3,0XE3,0XF0,0X00,0XE0,0X7F,0XF1,0XC0,0X1C,0X0F,0XC0,0X07,0X00,0X01,
  117. 0XC7,0XE3,0XE3,0XF0,0X00,0XE0,0X7F,0XF1,0XC0,0X1C,0X0F,0XC0,0X07,0X1F,0XF1,0XC7,
  118. 0X03,0XFC,0X00,0X07,0X00,0X0F,0XF1,0XFF,0XFF,0X8E,0X00,0X07,0X1F,0XF1,0XC7,0X03,
  119. 0XFC,0X00,0X07,0X00,0X0F,0XF1,0XFF,0XFF,0X8E,0X00,0X07,0X1F,0XF1,0XC7,0X03,0XFC,
  120. 0X00,0X07,0X00,0X0F,0XF1,0XFF,0XFF,0X8E,0X00,0X07,0X1F,0XF1,0XC0,0X03,0X83,0X81,
  121. 0XC7,0X1C,0X0E,0X0E,0X38,0X03,0X8F,0XC0,0X07,0X1F,0XF1,0XC0,0X03,0X83,0X81,0XC7,
  122. 0X1C,0X0E,0X0E,0X38,0X03,0X8F,0XC0,0X07,0X1F,0XF1,0XC0,0X03,0X83,0X81,0XC7,0X1C,
  123. 0X0E,0X0E,0X38,0X03,0X8F,0XC0,0X07,0X1F,0XF1,0XC7,0XE0,0XE0,0X70,0X07,0X1C,0X03,
  124. 0XF0,0X38,0XFF,0X81,0XC0,0X07,0X1F,0XF1,0XC7,0XE0,0XE0,0X70,0X07,0X1C,0X01,0XF0,
  125. 0X38,0XFF,0X81,0XC0,0X07,0X1F,0XF1,0XC7,0XE0,0XE0,0X70,0X07,0X1C,0X03,0XF0,0X38,
  126. 0XFF,0X81,0XC0,0X07,0X00,0X01,0XC0,0X00,0X1C,0X70,0X00,0X1F,0X8F,0X8F,0XC0,0XFC,
  127. 0X0E,0X00,0X07,0X00,0X01,0XC0,0X00,0X1C,0X70,0X00,0X1F,0X8F,0X8F,0XC0,0XFC,0X0E,
  128. 0X00,0X07,0X00,0X01,0XC0,0X00,0X1C,0X70,0X00,0X1F,0X8F,0X8F,0XC0,0XFC,0X0E,0X00,
  129. 0X07,0XFF,0XFF,0XC0,0XE3,0XFC,0X7F,0XC0,0XE3,0XF3,0X81,0XC7,0XFC,0X0F,0XC0,0X07,
  130. 0XFF,0XFF,0XC0,0XE3,0XFC,0X7F,0XC0,0XE3,0XF1,0X81,0XC7,0XFC,0X0F,0XC0,0X07,0XFF,
  131. 0XFF,0XC0,0XE3,0XFC,0X7F,0XC0,0XE3,0XE1,0X81,0XC7,0XFC,0X0F,0X80,0X00,0X00,0X00,
  132. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
  133. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
  134. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
  135. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
  136. 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,};
  137. void setup() {
  138. display.init(115200); // 初始化屏幕
  139. display.setRotation(1); // 设置屏幕旋转方向,分别有0,1,2,3这四个方向
  140. display.setTextWrap(false); // 设置文本是否自动换行,false则为不自动换行,如果文本溢出则显示异常或者不显示
  141. const char HelloWorld[] = "XiaoHuTongXue"; //
  142. display.setFont(&FreeMonoBold9pt7b); // 设置 文本字体
  143. display.setTextColor(GxEPD_BLACK); // 设置 文本颜色
  144. int16_t tbx, tby; // 文本框的x,y坐标
  145. uint16_t tbw, tbh; // 文本框的宽度,高度
  146. display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh); // 计算渲染后的文本框的长度和宽度,用于居中
  147. uint16_t x = ((display.width() - tbw) / 2) - tbx; // 文本框的x坐标
  148. uint16_t y = ((display.height() - tbh) / 2) - tby; // 文本框的y坐标
  149. display.setFullWindow();
  150. display.firstPage();
  151. do
  152. {
  153. display.fillScreen(GxEPD_WHITE); // 清屏(全平白色)
  154. // (POSITION_X, POSITION_Y, IMAGE_NAME, IMAGE_WIDTH, IMAGE_HEIGHT, COLOR)
  155. display.drawBitmap(0, 0, gImage_2, 120, 120, GxEPD_BLACK); // 在屏幕坐标(0,0)的位置显示 logo_1,大小为宽300,高86像素,颜色为黑色
  156. // display.drawBitmap(0,0, gImage_logo_2, 300,86, display.epd2.hasColor ? GxEPD_WHITE : GxEPD_BLACK); // 在屏幕坐标(0,0)的位置显示 logo_1,大小为宽300,高86像素,颜色为红色
  157. display.setCursor(x+50, y-30); // 设置指针位置
  158. display.print("XiaoHuTongXue"); // 显示文本
  159. display.setCursor(x+50, y);
  160. display.print("LaoTie!");
  161. display.setCursor(x+50, y+30);
  162. display.print("Double 666 !!!");
  163. }
  164. while (display.nextPage());
  165. }
  166. void loop() {
  167. }

效果

78cbf1d606d843b18e0df82d025b33c.jpg