summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoruvok2025-07-16 21:06:13 +0200
committeruvok2025-07-16 21:06:13 +0200
commita2d601cc2b8d98d5aaf56942833a67a934bd0452 (patch)
tree382d32b57c36a71a74c54d30779983251f63fe5f /src
parent89525668c3c8cf32b34e215ad740153c61e4c067 (diff)
Add crowpanel, and demo
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 838fde0..0f90d96 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -22,15 +22,25 @@
#endif
NimBLEServer *server;
-#if UVOK_EPAP_DISPLAY == 219
+#if UVOK_EPAP_DISPLAY == DISPLAY_WAVESHARE_219_YBW
// HINT: Update the library code, set budy timeout to 30 or 60 seconds!
// Small color
GxEPD2_3C<GxEPD2_213_Z19c, GxEPD2_213_Z19c::HEIGHT> display(GxEPD2_213_Z19c(22, 21, 17, 16));
-#elif UVOK_EPAP_DISPLAY == 290
+#elif UVOK_EPAP_DISPLAY == DISPLAY_WAVESHARE_290_BW
// larger b/w
// or T5
// GxEPD2_BW<GxEPD2_290_T5D, GxEPD2_290_T5D::HEIGHT> display(GxEPD2_290_T5D(22, 21, 17, 16));
GxEPD2_BW<GxEPD2_290_M06, GxEPD2_290_M06::HEIGHT> display(GxEPD2_290_M06(22, 21, 17, 16));
+#elif UVOK_EPAP_DISPLAY == DISPLAY_ELECROW_290_BW
+/*
+#define SCK 12
+#define MOSI 11
+#define RES 47
+#define DC 46
+#define CS 45
+#define BUSY 48
+*/
+GxEPD2_BW<GxEPD2_290_T94, GxEPD2_290_T94::HEIGHT> display(GxEPD2_290_T94(45, 46, 47, 48));
#else
#error "define display"
#endif
@@ -65,7 +75,16 @@ void setup()
pAdvertising = NimBLEDevice::getAdvertising();
pAdvertising->setName("NimBLE");
Serial.println("Init display...");
+
+#if UVOK_EPAP_DISPLAY == DISPLAY_ELECROW_290_BW
+ // Turn on once, let controller handle the rest, lest I want to do re-init...
+ pinMode(7, OUTPUT); // Set pin 7 as output mode
+ digitalWrite(7, HIGH); // Set pin 7 to high level to turn on the screen power
+ display.init(115200, true);
+#else
display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse
+#endif
+
display.hibernate();
Serial.println("Display done.");