How to display a dot on screen

So, in my project, I’m taking some reading from a sensor, and I get x, y data. Neither, x or y, is spaced equally w.r.t. previous reading, so I realized I cant use a chart as I understood from the documents, please correct me if I’m wrong. I was wondering how to simply show the plot of x, y on the screen?
Previously, I used Adafruit’s library and I could simply plot a rectangle of 1x1 dimension for each data point, calibrated wrt the screen size and the reading range.
The read values will be highly variable and I’ll calculate the range of both x and y axis in run time, the number of points will be in the range of 30-100 in one go.

On second thought, How can I use Adafruits library with Littlevgl for things like these?

Maybe you can look at this.



If you can get Adafruit’s library to render to a canvas, maybe that would help?

Otherwise maybe you could draw your own lines on a canvas.

I also suggest the canvas object. I’ve added an example about a transparent canvas with indexed (palette) colors.

You can use it put pixels on it as you need.

Thanks guys for the pointers,

So I was thinking about this how to do it, and I realized I can do it in two ways-

  1. With canvas object - in the docs I saw that the x-delta were too big and thus understood that only 5-10 points spaced equally can be shown. Later I realized that I just need to increase the resolution of this x-delta to say 1 pixel, and I can show 240 points horizontally.

  2. With adafruit’s library- I’m initializing the screen before loading littlevgl to remove the garbage on the display when esp32 wakes up, with a black screen fill with window size of 240x240 and then filling all the points with black, so for this requirement, I need to define a window of 1x1 size at point x,y and fill it with whatever color I want. There isn’t use of adafruit’s library per se, but this method seems a bit quicker and with less ram space. Let me try this one out and see if I can show anything on screen on top of littlevgl. Hope littlevgl doesn’t refresh screen after every x seconds automatically, and this method should be fine.

LittlevGL refreshes the screen only if something changes, however I don’t suggest to mix the libraries this way. A more appropriate approach would be create an lv_obj and change its design function to draw the pixels you need. Take look at this guide for the details.

I checked the design guide, its to the point, thanks, I’ll try this instead of mixing.
Thanks again!
Have a great weekend!