diff --git a/ESP32_ePaperDisplay-Node/.vscode/settings.json b/ESP32_ePaperDisplay-Node/.vscode/settings.json index bf356b34..91d95695 100644 --- a/ESP32_ePaperDisplay-Node/.vscode/settings.json +++ b/ESP32_ePaperDisplay-Node/.vscode/settings.json @@ -1,5 +1,5 @@ { - "idf.portWin": "COM19", + "idf.portWin": "COM15", "idf.adapterTargetName": "esp32", "idf.openOcdConfigs": [ "board/esp32-bridge.cfg" diff --git a/ESP32_ePaperDisplay-Node/src/ePaper.h b/ESP32_ePaperDisplay-Node/src/ePaper.h index 11b14337..0cef3e94 100644 --- a/ESP32_ePaperDisplay-Node/src/ePaper.h +++ b/ESP32_ePaperDisplay-Node/src/ePaper.h @@ -1,5 +1,10 @@ #include -#include // 4.2" b/w/r +//#include // 4.2" b/w/r +#include // 2.9" b/w/r +//#include +//#include +//#include +//#include #include GxEPD_BitmapExamples // FreeFonts from Adafruit_GFX #include @@ -14,37 +19,40 @@ #include #include -#if defined(ESP8266) -GxIO_Class io(SPI, /*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2); // arbitrary selection of D3(=0), D4(=2), selected for default of GxEPD_Class -GxEPD_Class display(io, /*RST=D4*/ 2, /*BUSY=D2*/ 4); // default selection of D4(=2), D2(=4) +//#if defined(ESP8266) +//GxIO_Class io(SPI, /*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2); // arbitrary selection of D3(=0), D4(=2), selected for default of GxEPD_Class +//GxEPD_Class display(io, /*RST=D4*/ 2, /*BUSY=D2*/ 4); // default selection of D4(=2), D2(=4) -#elif defined(ESP32) + +//#elif defined(ESP32) GxIO_Class io(SPI, /*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16); // arbitrary selection of 17, 16 GxEPD_Class display(io, /*RST=*/ 16, /*BUSY=*/ 4); // arbitrary selection of (16), 4 +//GxIO_Class io(SPI, SS, 22, 21); +//GxEPD_Class display(io, 16, 4); -#elif defined(ARDUINO_ARCH_SAMD) -GxIO_Class io(SPI, /*CS=*/ 4, /*DC=*/ 7, /*RST=*/ 6); -GxEPD_Class display(io, /*RST=*/ 6, /*BUSY=*/ 5); +//#elif defined(ARDUINO_ARCH_SAMD) +//GxIO_Class io(SPI, /*CS=*/ 4, /*DC=*/ 7, /*RST=*/ 6); +//GxEPD_Class display(io, /*RST=*/ 6, /*BUSY=*/ 5); -#elif defined(ARDUINO_GENERIC_STM32F103C) && defined(MCU_STM32F103C8) -GxIO_Class io(SPI, /*CS=*/ SS, /*DC=*/ 3, /*RST=*/ 2); -GxEPD_Class display(io, /*RST=*/ 2, /*BUSY=*/ 1); +//#elif defined(ARDUINO_GENERIC_STM32F103C) && defined(MCU_STM32F103C8) +//GxIO_Class io(SPI, /*CS=*/ SS, /*DC=*/ 3, /*RST=*/ 2); +//GxEPD_Class display(io, /*RST=*/ 2, /*BUSY=*/ 1); -#elif defined(ARDUINO_GENERIC_STM32F103V) && defined(MCU_STM32F103VB) -GxIO_Class io(SPI, /*CS=*/ SS, /*DC=*/ PE15, /*RST=*/ PE14); // DC, RST as wired by DESPI-M01 -GxEPD_Class display(io, /*RST=*/ PE14, /*BUSY=*/ PE13); // RST, BUSY as wired by DESPI-M01 +//#elif defined(ARDUINO_GENERIC_STM32F103V) && defined(MCU_STM32F103VB) +//GxIO_Class io(SPI, /*CS=*/ SS, /*DC=*/ PE15, /*RST=*/ PE14); // DC, RST as wired by DESPI-M01 +//GxEPD_Class display(io, /*RST=*/ PE14, /*BUSY=*/ PE13); // RST, BUSY as wired by DESPI-M01 -#elif defined(ARDUINO_AVR_MEGA2560) +//#elif defined(ARDUINO_AVR_MEGA2560) // select one, depending on your CS connection //GxIO_Class io(SPI, /*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9); // arbitrary selection of 8, 9 selected for default of GxEPD_Class //GxIO_Class io(SPI, /*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9); // arbitrary selection of 8, 9, CS on 10 (for CS same as on UNO, for SPI on ICSP use) -GxEPD_Class display(io, /*RST=*/ 9, /*BUSY=*/ 7); // default selection of (9), 7 -#else +// //GxEPD_Class display(io, /*RST=*/ 9, /*BUSY=*/ 7); // default selection of (9), 7 +//#else -GxIO_Class io(SPI, /*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9); // arbitrary selection of 8, 9 selected for default of GxEPD_Class -GxEPD_Class display(io, /*RST=*/ 9, /*BUSY=*/ 7); // default selection of (9), 7 -#endif +// //GxIO_Class io(SPI, /*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9); // arbitrary selection of 8, 9 selected for default of GxEPD_Class +// //GxEPD_Class display(io, /*RST=*/ 9, /*BUSY=*/ 7); // default selection of (9), 7 +//#endif class Dashboard { private: diff --git a/ESP32_ePaperDisplay-Node/src/main.cpp b/ESP32_ePaperDisplay-Node/src/main.cpp index d5956284..894f76f4 100644 --- a/ESP32_ePaperDisplay-Node/src/main.cpp +++ b/ESP32_ePaperDisplay-Node/src/main.cpp @@ -14,15 +14,18 @@ void setup() { // Initialize ePaper display display.init(115200); + display.fillScreen(GxEPD_BLACK); + display.update(); display.fillScreen(GxEPD_WHITE); display.setTextColor(GxEPD_BLACK); display.setFont(&FreeMono9pt7b); - display.setCursor(205, 10); - display.print("ESP32_DisplayNode"); // Takes 195 pixels in width + //display.setCursor(205, 10); + //display.print("ESP32_DisplayNode"); // Takes 195 pixels in width display.setCursor(5, 5); display.setFont(&TomThumb); display.print("10.100.50.105"); + display.update(); // Add UI elements // Draw axis: (x1,y1) @ 5, 100 and width-2*margin_x height-2*margin_y display.drawRect(5, 155, display.width()-10, display.height()-160, GxEPD_RED);