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

Support For Animation Or c Array for Showing Images Like u8g2 #4

Open
parthbhat13 opened this issue Sep 18, 2023 · 3 comments
Open

Comments

@parthbhat13
Copy link

Hi,
First off thank you very much for being so supportive and sharing the resources. i have always learnt a lot from your examples. perhaps after spending over a week i had no option but to drop a issue request.
is it possible with the library you have made, to make a animated frames? I have used bmp quite a lot but it is bit difficult as not every bmp works and i could not spend time going in depth of the BMP format, as well, it is kinda slow reading from spiffs and showing the BMP all the time when we are trying to show the animation.

else if there can be some option in the library like the u8g2 where we can drop in C array and just show the animations?
while i write this my next step is to try and figure out how can we add the u8g2 type array so we can show the animation but thought to drop you the request as well.

attaching two videos on what i am trying to do. they are examples of OLED but im using the ST7565

https://www.youtube.com/watch?v=o3PhC_VJdXo
https://www.youtube.com/watch?v=0KGMFhFQ0YY

finally ofcourse we could use the u8g2 altogether but i love your library as i found it to be lightweight.
so thanks in advance.

Parth

@parthbhat13
Copy link
Author

Hi,

so far I was able to make things work, here is the code snippet which i used. its not formatted but did the job for me. if anyone else faces the same problem they can use it.

void drawBitmapOne(TFT_t * dev, uint16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)
{
	lcdFillScreen(dev, WHITE);
	int16_t byteWidth = (w + 7) / 8; // Bitmap scanline pad = whole byte
  	uint8_t b = 0;

  for (int16_t j = 0; j < h; j++, y++) {
    for (int16_t i = 0; i < w; i++) {
      if (i & 7)
        b <<= 1;
      else
        b = pgm_read_byte(&bitmap[j * byteWidth + i / 8]);
      if (b & 0x80)
        lcdDrawPixel(dev, x + i, y, BLACK);
    }
  }
  lcdWriteBuffer(dev);
}

and can be used with any of the above mentioned videos. works fine for me.

Parth

@nopnop2002
Copy link
Owner

nopnop2002 commented Sep 18, 2023

Have you ever used SSD1306?

It is cheaper than ST7565 and the display is beautiful and clear.

Animation is possible because it can draw faster than ST7565.

This is available.

https://github.com/nopnop2002/esp-idf-ssd1306

Once you use SSD1306, you can't go back to ST7565.

@parthbhat13
Copy link
Author

Hi,
Thanks a lot for your response.
Yes I've used ssd1306 but the display is too small for my project which I'm working on. I was wanting to use the ssd1309 which is 2.4 inch but they are way too costly in India to get hold of. Hence I decided to use the st7565 from Sinda.

After dropping you the issue comment, and after I solved, I've been working on making 4x6Px font work on the display. I should've spent more time understanding the basics than jumping into implementation so now I'm stuck with trying to make some fonts work with this code. Perhaps, any suggestions from you would be very very much welcomed.

Thanks in advance
Parth..

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