From 7068ba3f35a66078de37968a20eb884aba082841 Mon Sep 17 00:00:00 2001 From: ZinggJM Date: Thu, 9 Dec 2021 09:50:17 +0100 Subject: [PATCH] Version 1.4.0 - changed the default reset duration to 10ms instead of 20ms - changed the delay after reset to 10ms or reset duration, whichever is higher, instead of 200ms - added a busyCallback feature, to allow to service periodic actions during wait for BUSY termination - ` // register a callback function to be called during _waitWhileBusy continuously. ` - ` void setBusyCallback(void (*busyCallback)(const void*), const void* busy_callback_parameter = 0); ` - added example GxEPD2_RotaryUsingBusyCallback.ino --- .../GxEPD2_RotaryUsingBusyCallback.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/GxEPD2_RotaryUsingBusyCallback/GxEPD2_RotaryUsingBusyCallback.ino b/examples/GxEPD2_RotaryUsingBusyCallback/GxEPD2_RotaryUsingBusyCallback.ino index a210c04..e56844b 100644 --- a/examples/GxEPD2_RotaryUsingBusyCallback/GxEPD2_RotaryUsingBusyCallback.ino +++ b/examples/GxEPD2_RotaryUsingBusyCallback/GxEPD2_RotaryUsingBusyCallback.ino @@ -44,6 +44,8 @@ // define the pins to be used by the BasicEncoder const int8_t pinA = 5; // D1 on my Wemos D1 mini const int8_t pinB = 16; // D0 on my Wemos D1 mini +//const int8_t pinA = 2; // on UNO +//const int8_t pinB = 3; // on UNO BasicEncoder encoder(pinA, pinB); @@ -59,7 +61,8 @@ void setup() Serial.println(); Serial.println("setup"); delay(100); - display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02 + display.init(); // disable diagnostics to avoid delay and catch most rotary pulses + //display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02 //display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse display.epd2.setBusyCallback(busyCallback); // register callback to be called during BUSY active time // first update should be full refresh @@ -112,6 +115,7 @@ const char EncoderValue[] = "Encoder = "; class PrintString : public Print, public String { public: + PrintString(const char s[]) : String(s){}; size_t write(uint8_t data) override { return concat(char(data));