Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hurray for ssd1306_bitmaps() #19

Open
cvonk opened this issue Apr 27, 2022 · 6 comments
Open

Hurray for ssd1306_bitmaps() #19

cvonk opened this issue Apr 27, 2022 · 6 comments

Comments

@cvonk
Copy link

cvonk commented Apr 27, 2022

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
Copy link
Owner

nopnop2002 commented Apr 27, 2022

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
Copy link
Author

cvonk commented Apr 27, 2022 via email

@nopnop2002
Copy link
Owner

@cvonk
Copy link
Author

cvonk commented May 5, 2022 via email

@cvonk
Copy link
Author

cvonk commented May 5, 2022

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants