nopnop2002 / esp-idf-ssd1306

SSD1306/SH1106 Driver for esp-idf
MIT License
238 stars 68 forks source link

Hurray for ssd1306_bitmaps() #19

Open cvonk opened 2 years ago

cvonk commented 2 years ago

Thanks for the bitmaps function. I am using it!

Just ran into something that could use some attention.

In the new function

void ssd1306_bitmaps(SSD1306_t * dev, int xpos, int ypos, uint8_t * bitmap, int width, int height, bool invert)

The xpos, ypos and height parameters are in pixels. I suggest either changing the parameter width to mean width in pixels, or renaming it so that it is clear that it is pixels/8.

Also, the ImageDemo example calls

ssd1306_bitmaps(&dev, xpos, ypos, batman, 4, 12, false);

It passes the height as 12, but the image in the array batman[] is 13 pixels heigh.

/Coert

nopnop2002 commented 2 years ago

I accepted your suggestion and changed the unit of the width parameter from bytes to pixels.

However, width only supports multiples of 8. I can get rid of this limitation with a little code addition, but I decided it wasn't practical.

//ssd1306_bitmaps(&dev, xpos, ypos, batman, 4, 12, false);
ssd1306_bitmaps(&dev, xpos, ypos, batman, 32, 13, false);

Thank you for your suggestion.

cvonk commented 2 years ago

thanks

On Tue, Apr 26, 2022 at 9:58 PM nopnop2002 @.***> wrote:

I accepted your suggestion and changed the unit of the width parameter from bytes to pixels.

However, width only supports multiples of 8.

//ssd1306_bitmaps(&dev, xpos, ypos, batman, 4, 12, false); ssd1306_bitmaps(&dev, xpos, ypos, batman, 32, 13, false);

— Reply to this email directly, view it on GitHub https://github.com/nopnop2002/esp-idf-ssd1306/issues/19#issuecomment-1110541248, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKIDGWQSIXVGJXPSAXITFTVHDCOFANCNFSM5UNVVYYA . You are receiving this because you authored the thread.Message ID: @.***>

-- /c

nopnop2002 commented 2 years ago

I found that ssd1306_bitmaps can't be drawn too quickly. Please try this.

https://github.com/nopnop2002/esp-idf-ssd1306/tree/master/AnimationDemo https://github.com/nopnop2002/esp-idf-ssd1306/tree/master/MeterDemo

cvonk commented 2 years ago

Will look, but I couldn't use the bitmaps, because they clear the screen. I resorted back to displaying a 16x8 bitmap using two character bitmaps.

Cheers, /c

On Sun, May 1, 2022 at 6:11 AM nopnop2002 @.***> wrote:

I found that ssd1306_bitmaps can't be drawn too quickly. Please try this.

https://github.com/nopnop2002/esp-idf-ssd1306/tree/master/AnimationDemo https://github.com/nopnop2002/esp-idf-ssd1306/tree/master/MeterDemo

— Reply to this email directly, view it on GitHub https://github.com/nopnop2002/esp-idf-ssd1306/issues/19#issuecomment-1114233661, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKIDGQXJ3VLBISC7YNRNRDVHZ7IHANCNFSM5UNVVYYA . You are receiving this because you authored the thread.Message ID: @.***>

-- /c

cvonk commented 2 years ago

Noticed you run SPI_CLK at 1 MHz. Surprised you need short wires. Remember seeing it should go up to 8 or 10 MHz.

nopnop2002 commented 2 years ago

I tried it at a frequency of 2M but it didn't draw correctly in my module.