A
A
Arseniy Ivanov2020-08-10 22:20:18
Arduino
Arseniy Ivanov, 2020-08-10 22:20:18

How to send ssd1306 display buffer to html page as image?

Hello, I want to send an image of my ssd1306 display to the html page. How can this be implemented? Please provide an example code. I'm using the ssd1306_adafruit library, I get the display buffer display.getBuffer() and I don't know what to do next. The return value of the buffer is of type uint8_t*. I want to note that I use an esp32 board. I am creating a WiFi hotspot and this hotspot has an html page at 192.168.4.1. Sending to the page is done via client.send (), I would put a buffer here, but unfortunately it does not accept a type.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
milssky, 2020-08-10
@milssky

.getBuffer() gives a pointer to the beginning of the display buffer.
1. Read the buffer
2. Write a display emulator in js
3. Feed the resulting buffer to the emulator
4. Profit (get the display image from the buffer)

K
Konstantin Zaitsev, 2020-08-10
@KonstantineZ

The return value of a buffer of type uint8_t*.

An asterisk in a type denotes a pointer, i.e. actually stores the address in memory where the variable lies, and not the value of the variable itself. Further, adafruit uses the Adafruit-GFX unified graphics library, which stores the pixel color value as uint8_t, i.e. "unsigned int", occupying 2 bytes in memory. You need to read from RAM a one-dimensional uint8_t array, the size of which is equal to the number of display pixels. What to do next has already been answered by milssky.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question