Comments (2)
What wrong assumptions am I making about the display or the library?
I think the key thing here is that both clear()
and fastmodeOn()
should be called outside of the DRAW
loop.
-
clear()
is a standalone method, called outside of theDRAW
loop, which replaces the display's contents with WHITE (unless changed usingsetDefaultColor()
). Fastmode setting is ignored by theclear()
operation; a full refresh (non-fast) is used, in order to reduce the chance of ghosting. -
fastmodeOn()
configures the display to use fast mode ("partial refresh") for all subsequentDRAW
operations. It should be called before theDRAW
loop.
The purpose of the DRAW
loop is to identify which commands should be re-run if the display image needs to be recalculated several times, as part of the "paged drawing" technique used to save RAM.
Because clear()
performs an "all-at-once" wipe, and fastmodeOn()
sets a persistent config. option, neither should be placed inside the DRAW
loop. This will cause them to be run, and possibly re-run, after the hardware init process which occurs at the start of DRAW
.
This concept is not made particularly clear, and I will need to look into re-writing the doc to highlight the true purpose of DRAW
. A simpler fastmode example might also be called for, and possibly a lockout to prevent fastmodeON()
and clear()
from being called inside DRAW
altogether.
You may find it useful to reference the code snippet given in the API:
#include <heltec-eink-modules.h>
DEPG0150BNS810 display(2, 4, 5);
void setup() {
display.clear();
// Begin fastmode
display.fastmodeOn();
DRAW (display) {
display.setCursor(10, 10);
display.print("ON");
}
delay(2000);
DRAW (display) {
display.setCursor(10, 10);
display.print("still ON");
}
delay(2000);
// Back to normal drawing
display.fastmodeOff();
display.setWindow(0, 40, 100, 100);
DRAW (display) {
display.setCursor(10, 40);
display.print("OFF now..");
}
}
void loop() {}
Note that if you are 100% certain your display is blank, you do not need to call clear()
before entering fastmode.
Arduino Mega 2560
Note that with Mega2560 and DEPG0150BNS810, there is sufficient RAM that paging is not used by default.
This uses 5000kB of the 8000kB available SRAM (>60%). If you wish to reduce this, you can renable paging in the constructor. The trade-off is reduced speed.
If you choose not to enable paging, you are also free to use the alternate syntax outlined in API: update(), and the update.ino example.
Hopefully this helps point you in the right direction. Please let me know if I have misunderstood the problem.
from heltec-eink-modules.
Thanks for the reply! I'll try out the approach described soon.
from heltec-eink-modules.
Related Issues (11)
- HELTEC 2.90" V2 - Multiple incompatible versions circulating HOT 5
- V4.1.0 fails to build on ESP8266 HOT 1
- Partial refresh inbetween deep sleeps HOT 6
- Compiling HOT 9
- Heltec 1.54" V2 display incompatible/wrong resolution HOT 21
- ESP8266/ESP32 Support HOT 9
- SPI pins not configurable for ESP32 HOT 1
- ESP8266: can't get Black to show. HOT 5
- Refreshing the display in fast mode. HOT 2
- Text inside DRAW() is scrambled, unless setCursor() is called
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heltec-eink-modules.