platformio.ini
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
zinggjm/GxEPD2 @ ^1.5.0
main.cpp
#include <Arduino.h>
// GxEPD2_HelloWorld.ino by Jean-Marc Zingg
// see GxEPD2_wiring_examples.h for wiring suggestions and examples
// if you use a different wiring, you need to adapt the constructor parameters!
// uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX
//#include <GFX.h>
#include <GxEPD2_BW.h>
#include <GxEPD2_3C.h>
#include <Fonts/FreeMonoBold9pt7b.h>
// select the display class and display driver class in the following file (new style):
#include "GxEPD2_display_selection_new_style.h"
// or select the display constructor line in one of the following files (old style):
#include "GxEPD2_display_selection.h"
#include "GxEPD2_display_selection_added.h"
// alternately you can copy the constructor from GxEPD2_display_selection.h or GxEPD2_display_selection_added.h to here
// e.g. for Wemos D1 mini:
//GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154D67
void setup()
{
display.init(115200);
helloWorld();
display.hibernate();
}
const char HelloWorld[] = "Hello World!";
void helloWorld()
{
display.setRotation(1);
display.setFont(&FreeMonoBold9pt7b);
display.setTextColor(GxEPD_BLACK);
int16_t tbx, tby; uint16_t tbw, tbh;
display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
// center the bounding box by transposition of the origin:
uint16_t x = ((display.width() - tbw) / 2) - tbx;
uint16_t y = ((display.height() - tbh) / 2) - tby;
display.setFullWindow();
display.firstPage();
do
{
display.fillScreen(GxEPD_WHITE);
display.setCursor(x, y);
display.print(HelloWorld);
}
while (display.nextPage());
}
void loop() {};
Build
Task wird im Ordner Test4 ausgeführt: C:\Users\CarstenTower\.platformio\penv\Scripts\platformio.exe run --environment esp32dev
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.0.1) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20006.221224 (2.0.6)
- tool-esptoolpy @ 1.40400.0 (4.4.0)
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 36 compatible libraries
Scanning dependencies...
Dependency Graph
|-- GxEPD2 @ 1.5.0
| |-- Adafruit GFX Library @ 1.11.5
| | |-- Adafruit BusIO @ 1.14.1
| | | |-- Wire @ 2.0.0
| | | |-- SPI @ 2.0.0
| | |-- Wire @ 2.0.0
| | |-- SPI @ 2.0.0
| |-- Adafruit BusIO @ 1.14.1
| | |-- Wire @ 2.0.0
| | |-- SPI @ 2.0.0
| |-- Wire @ 2.0.0
| |-- SPI @ 2.0.0
|-- Adafruit GFX Library @ 1.11.5
| |-- Adafruit BusIO @ 1.14.1
| | |-- Wire @ 2.0.0
| | |-- SPI @ 2.0.0
| |-- Wire @ 2.0.0
| |-- SPI @ 2.0.0
Building in release mode
Compiling .pio\build\esp32dev\src\main.cpp.o
Archiving .pio\build\esp32dev\libda8\libAdafruit BusIO.a
src/main.cpp:16:10: fatal error: GxEPD2_display_selection_new_style.h: No such file or directory
********************************************************************************************
* Looking for GxEPD2_display_selection_new_style.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:GxEPD2_display_selection_new_style.h"
* Web > https://registry.platformio.org/search?q=header:GxEPD2_display_selection_new_style.h
*
********************************************************************************************
#include "GxEPD2_display_selection_new_style.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pio\build\esp32dev\libeff\Adafruit GFX Library\Adafruit_GrayOLED.cpp.o
Compiling .pio\build\esp32dev\libeff\Adafruit GFX Library\Adafruit_SPITFT.cpp.o
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1
======================================================== [FAILED] Took 13.72 seconds ========================================================
* Der Terminalprozess "C:\Users\CarstenTower\.platformio\penv\Scripts\platformio.exe 'run', '--environment', 'esp32dev'" wurde mit folgendem Exitcode beendet: 1.
* Das Terminal wird von Aufgaben wiederverwendet, drücken Sie zum Schließen eine beliebige Taste.