110 lines
4.7 KiB
Plaintext
110 lines
4.7 KiB
Plaintext
Compiling instructions:
|
|
|
|
In order to compile this you need: Arduino Libraries, ArduinoOTA (included in ESP32 2.0.2+), SmallRTC (1.6 or greater, GuruSR), SmallNTP (GuruSR), StableBMA (GuruSR), Olson2POSIX (GuruSR) AND Watchy (1.2.9 or greater) base.
|
|
|
|
**VERSION 1.4.3+ CHANGES**
|
|
|
|
Go into the Watchy library folder and move the following files out of it, otherwise it may not compile as these files are out of date:
|
|
|
|
Watchy.h, Watchy.cpp, WatchyRTC.h and WatchyRTC.cpp they are not needed at all.
|
|
|
|
**VERSION 1.4.1 CHANGES**
|
|
|
|
Requires Watchy base 1.2.9 or greater, as well as the above libraries. When editing the file changes below, DO NOT COPY items that say not to, instead make the changes or copy in the changes to avoid compiler errors.
|
|
|
|
You'll need to edit 2 files:
|
|
|
|
**NOTE** The two files can be found in Arduino->Libraries->GxEPD2->src->epd (for PlatformIO, you'll need to look where it is stored for your setup).
|
|
|
|
GxEPD2_154_D67.cpp:
|
|
|
|
Copy the code below:
|
|
|
|
bool IsDark; // GuruSR: Changed for setDarkBorder
|
|
void GxEPD2_154_D67::setDarkBorder(bool Dark){ // GuruSR: Changed for setDarkBorder
|
|
IsDark=Dark; // GuruSR: Changed for setDarkBorder
|
|
} // GuruSR: Changed for setDarkBorder
|
|
|
|
And add it to just under this code: (Note, the uint8/16_t's below can either be uint8_t or uint16_t based on GxEPD2 version, don't copy those lines.)
|
|
|
|
GxEPD2_154_D67::GxEPD2_154_D67(int8/16_t cs, int8/16_t dc, int8/16_t rst, int8/16_t busy) :
|
|
GxEPD2_EPD(cs, dc, rst, busy, HIGH, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate)
|
|
{
|
|
}
|
|
|
|
So when you're done, it looks like this:
|
|
|
|
GxEPD2_154_D67::GxEPD2_154_D67(int8/16_t cs, int8/16_t dc, int8/16_t rst, int8/16_t busy) :
|
|
GxEPD2_EPD(cs, dc, rst, busy, HIGH, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate)
|
|
{
|
|
}
|
|
|
|
bool IsDark; // GuruSR: Changed for setDarkBorder
|
|
void GxEPD2_154_D67::setDarkBorder(bool Dark){ // GuruSR: Changed for setDarkBorder
|
|
IsDark=Dark; // GuruSR: Changed for setDarkBorder
|
|
} // GuruSR: Changed for setDarkBorder
|
|
|
|
|
|
Change the code in _initdisplay from:
|
|
|
|
void GxEPD2_154_D67::_InitDisplay()
|
|
{
|
|
if (_hibernating) _reset();
|
|
delay(10); // 10ms according to specs
|
|
_writeCommand(0x12); // soft reset
|
|
delay(10); // 10ms according to specs
|
|
_writeCommand(0x01); // Driver output control
|
|
_writeData(0xC7);
|
|
_writeData(0x00);
|
|
_writeData(0x00);
|
|
_writeCommand(0x3C); // BorderWavefrom
|
|
_writeData(0x05); <- THIS LINE NEEDS TO BE CHANGED, LOOK BELOW!
|
|
_writeCommand(0x18); // Read built-in temperature sensor
|
|
_writeData(0x80);
|
|
_setPartialRamArea(0, 0, WIDTH, HEIGHT);
|
|
}
|
|
|
|
to:
|
|
|
|
void GxEPD2_154_D67::_InitDisplay()
|
|
{
|
|
if (_hibernating) _reset(); <- DO NOT COPY THIS
|
|
delay(10); // 10ms according to specs <- DO NOT COPY THIS
|
|
_writeCommand(0x12); // soft reset <- DO NOT COPY THIS
|
|
delay(10); // 10ms according to specs <- DO NOT COPY THIS
|
|
_writeCommand(0x01); // Driver output control <- DO NOT COPY THIS
|
|
_writeData(0xC7); <- DO NOT COPY THIS
|
|
_writeData(0x00); <- DO NOT COPY THIS
|
|
_writeData(0x00); <- DO NOT COPY THIS
|
|
_writeCommand(0x3C); // BorderWavefrom <- DO NOT COPY THIS
|
|
_writeData(IsDark ? 0x02 : 0x05); // GuruSR: Changed for setDarkBorder
|
|
_writeCommand(0x18); // Read built-in temperature sensor <- DO NOT COPY THIS
|
|
_writeData(0x80); <- DO NOT COPY THIS
|
|
_setPartialRamArea(0, 0, WIDTH, HEIGHT); <- DO NOT COPY THIS
|
|
}
|
|
|
|
Edit GxEPD2_154_D67.h:
|
|
|
|
After:
|
|
#define _GxEPD2_154_D67_H_
|
|
|
|
Add:
|
|
#define GxEPD2DarkBorder
|
|
|
|
It should look like this:
|
|
#define _GxEPD2_154_D67_H_
|
|
#define GxEPD2DarkBorder
|
|
|
|
Further down look for:
|
|
|
|
void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
|
|
|
|
Add the void setDarkBorder line below after the line above so it looks like:
|
|
|
|
void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
|
|
void setDarkBorder(bool Dark); // GuruSR: Changed for setDarkBorder
|
|
|
|
Make a backup of these two files if you happen to update a newer version of GxEPD2.
|
|
|
|
This will allow the compilation on either Arduino or PlatformIO.
|