Comments (15)
What type of plot are you trying to draw? Can I have a look at the code? It seems to me that you have have run out of memory (this happens, for example, on the arduino uno if you use the spline datasource)
from grafici-gfx.
Your basic example code, actually all three/four variations of it.
No memory problems, because it's running on an ESP32.
from grafici-gfx.
I updated the wiki with more info on how the coordinate system works (still a WIP). I hope it helps
from grafici-gfx.
No, just a white screen, no matter any parameter.
from grafici-gfx.
At creation Grafici will clear your display. This could be one of your problems. Could you try to comment the fill_rect
line?
Grafici(Adafruit_GFX &hal)
: _display_driver{ hal }
{
_display_driver.fill_rect({ 0, 0 }, { 1, 1 }, black);
}
Still, I would expect a black background rather than a white one
from grafici-gfx.
Can you try this basic example?
void setup(void)
{
gfx.begin();
Grafici plot{ gfx };
unsigned int raw_data[] = {1, 2, 4, 5, 2};
DataArrayXY<unsigned int> data{ raw_data, 5};
plot.set_color_map(black_and_white);
plot.line(data.x(), data.y(), data.y(), full_screen);
}
void loop(void)
{
}
from grafici-gfx.
I added the part to initialize GxEPD2 instead of the regular Adafruit GFX, to make it compatible with my display, but I am still only getting a white or rather gray screen.
I also tried putting the actual drawing code info the required nextPage wrapper, which seems like it is required to be able to desigate when to render and actually send the data to the epaper.
from grafici-gfx.
At creation Grafici will clear your display. This could be one of your problems. Could you try to comment the
fill_rect
line?Grafici(Adafruit_GFX &hal) : _display_driver{ hal } { _display_driver.fill_rect({ 0, 0 }, { 1, 1 }, black); }Still, I would expect a black background rather than a white one
I already commented that out and before also changed black to white, because I thought it might help to at least display, the other stuff on the screen, but sadly no.
Well, it's a gray/white screen, which looks like an unititialized state, or an aborted reset operation or so. epaper displays special love to display items on the screen.
from grafici-gfx.
Example code:
#include <GxEPD2_BW.h>
#define ENABLE_GxEPD2_GFX 0 // also tried turning it on/1
#define DISPLAY_BUSY 4
#define DISPLAY_RST 0
#define DISPLAY_DC 2
#define DISPLAY_CS 15
/* setup display driver */
GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> display(GxEPD2_420(DISPLAY_CS, DISPLAY_DC, DISPLAY_RST, DISPLAY_BUSY));
SPIClass hspi(HSPI);
#include "Grafici.h"
constexpr size_t ARRAY_SIZE = 25;
constexpr size_t MAX_VALUE = 255;
unsigned int raw_data[ARRAY_SIZE];
DataArrayXY<unsigned int> data{ raw_data, ARRAY_SIZE, { 0, MAX_VALUE } };
void setup(void)
{
Serial.begin(115200);
Serial.println("Hello!");
/* init display driver and select landscape mode */
display.init(115200, true, 2, false, hspi, SPISettings(4000000, MSBFIRST, SPI_MODE0));
Serial.println("step1");
display.firstPage();
do {
display.fillScreen(GxEPD_WHITE);
display.println("Starting...");
display.println(millis());
} while (display.nextPage());
Serial.println("step1b");
// Init the plotting library with the display driver
Grafici plot{ display };
Serial.println("step2");
// generate some random data and save it into `raw_data`
randomSeed(66);
for (size_t i = 0; i < ARRAY_SIZE; ++i)
{
raw_data[i] = random(MAX_VALUE + 1);
}
Serial.println("step3");
auto graph_window = full_screen.sub_window({ 0, 1 }, { .2, .6 });
// Set the color map
plot.set_color_map(black_and_white);
Serial.println("step4");
// break plot lines in multiple segments to create a gradient of colors between two data points
PlotLineOpts opts;
opts.segments = 10;
Serial.println("step5");
// Plot data as a line. Color line using `data_y`
plot.line(data.x(), data.y(), data.y(), graph_window, opts);
Serial.println("step6");
}
void loop(void)
{
}
I also tried extending the do ... while nextPage loop that i mentioned above up to the plot.line part, no change unfortunately.
from grafici-gfx.
from the docs
drawing to full screen buffer is done using Adafruit_GFX methods without picture loop or drawCallback
and then calling method display()
try the following:
display.init(115200, true, 2, false, hspi, SPISettings(4000000, MSBFIRST, SPI_MODE0));
Grafici plot{ display };
plot.set_color_map(black_and_white);
plot.line(data.x(), data.y(), data.y(), full_screen);
display.display(false);
Basically, use display()
rather than firstPage()
and nextPage()
from grafici-gfx.
I looked at this example
https://github.com/ZinggJM/GxEPD2/blob/master/examples/GxEPD2_NotPagedExample/GxEPD2_NotPagedExample.ino
from grafici-gfx.
from the docs
drawing to full screen buffer is done using Adafruit_GFX methods without picture loop or drawCallback
and then calling method display()Basically, use
display()
rather thanfirstPage()
andnextPage()
Thank you very much, using a non-paged approach for the views where your graph library is used, allowed me to display the graph on the e-Paper screen.
from grafici-gfx.
Grafici(Adafruit_GFX &hal) : _display_driver{ hal } { _display_driver.fill_rect({ 0, 0 }, { 1, 1 }, black); }
Being able to disable this, would be awesome btw ;)
from grafici-gfx.
done
from grafici-gfx.
done
Well done! 😄 Thank you again!
May this be released as 3.1.1 or 3.2.0?
from grafici-gfx.
Related Issues (20)
- Create 'dotwork' plot object
- skyline plot similar to boxplot but with a continuous line
- scatter plot with rotation of marker (cross, line)
- 2d interpolator
- bw heatmap with circles with different radius
- fix class constness
- add custom functions to parametric datasource HOT 1
- create fancy header image for readme and documentation
- remove .development when possible
- More explanation on how to configure plots ? HOT 6
- Library is not compiling
- Properly namespace all methods HOT 2
- Add color blending to lines HOT 1
- Add linear interpolation to channels c and opt for low-memory arduinos
- Figure out a way to link the range of multiple DataSource/DataSet
- DIfferentiate between unit test example, data-vis examples and tutorial examples HOT 1
- Move documentation from readme to wiki
- Merge first version of release 2
- Make geometry transformable
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 grafici-gfx.