电子纸显示器和树莓派 Pico

时间:2021-03-26 09:43:26

标签: embedded raspberry-pi-pico

我们一直致力于让电子纸显示器与 Raspberry Pi Pico 板配合使用的项目。我们已经设法让一切都与 ESP8266 板一起工作,但出于耗电的原因,我们想使用 Pico。电子纸显示器我们使用的是Waveshare 2.9" SPI。

我们正在尝试使用这个库:https://github.com/ZinggJM/GxEPD2

它与 ESP8266 一起工作得很好,有人设法让它也与 Raspberry Pi Pico 一起工作,如果是这样,您能否提供任何提示以使其与 Pico 一起工作?请找到我们收到的附加错误信息。

Error message screenshot

这是我收到的错误消息:

Arduino: 1.8.13 (Windows 10), Board: "Raspberry Pi Pico, Serial, None"

C:\Users\   \Documents\Arduino\libraries\GxEPD2\src\GxEPD2_EPD.cpp:17:10: fatal error: pgmspace.h: No such file or directory

   17 | #include <pgmspace.h>
      |          ^~~~~~~~~~~~

compilation terminated.
exit status 1
Error compiling for board Raspberry Pi Pico.

来自该文件 GxEPD2_EPD.cpp:17:10 的以下行:

14 #if defined(ESP8266) || defined(ESP32) 
15 #include <pgmspace.h>
16 #else
17 #include <avr/pgmspace.h>
18  #endif

1 个答案:

答案 0 :(得分:0)

它找不到的头是pgmspace.h,它支持访问基于AVR的arduinos(使用哈佛内存模型)上的程序内存。大多数基于 32 位的 CPU 不需要这样做,因为它们具有平坦的冯诺依曼内存模型。许多其他 32 位板(例如用于 Arduino Due 或 ESP32 的板)包含一个虚拟头文件来模拟 AVR 行为。由于这些只是替换宏,因此您可以使用 Arduino Due 的实现(在概念上与 Raspberry Pico 非常接近)。定义为 here