Waveshare 4.2"-How To read and display BMP images from SD - Arduino

For a once daily cycling picture frame project based on the 4.2in e-Paper Display Module and an SD Module on SPI bus connected to Arduino Uno/Nano. I have connected the hardware and can control separately the SD (cardinfo) and the Display using Waveshare library example and the SD library standard with Arduino IDE. I had converted images to .c files using Image2LCD v3.2. Now how do I read the .c images (in HEX) to be displayed on e-Paper? I figure I have to read the data into an array or string?

{I found the download from Waveshare confusing - code is broken out to a pile of tabs. Anyone else find this a bit cumbersome? }

Appreciate some help or a link to get nudged by..
@johnwasser
@venombottle

@casperdroid5, I want to do the same project: Display series of BMP images from SD to E-paper once a day- mine is a Waveshare 4.2" 2 colour. Would you post your finished code from October?

Yeah sure. I'll create a post when my project is finished! I can give you the code beforehand

Thanks! You ever use either of the GxEPD, GxEPD2 libraries for e-ink? There's example code with SD to display available. I can't fit it on an Arduino - exceeds memory - but I can get it into an ESP32.

https://github.com/ZinggJM/GxEPD2

GxEPD2/GxEPD2_SD_AVR_Example.ino at master · ZinggJM/GxEPD2 · GitHub

Sketch uses 19496 bytes (60%) of program storage space. Maximum is 32256 bytes.
Global variables use 1676 bytes (81%) of dynamic memory, leaving 372 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.

Not re-tested. Don't know if it still works.

Hey Saturnvii,

I have never worked with GIT before, so I hope I did everything right. Here is everything you need and a BMP file to test!

note: you need to name the bmp file as the code it expects. The mosfet is so i can shut the power off to the E-ink display for even lower power.

Again. I am going to post a build/diy project soon. There I will explain everything clearly so it would be easy to reproduce.

This is fantastic! Thanks so much! Let me tinker over the next day or two. Thanks too for the example bmp file - I was wondering what the format would look like as I load up the SD with images. Big Help! Be useful if someone were to put it all together for those with the 4.2 in eink display. In hindsight, I'd have considered the 4.3 in with the SD card reader.

Yes, I ran the GxEPD_SD_Example set for Arduino Uno and 4.2 in display. I get an compiling error -

Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno"

data section exceeds available space in boardSketch uses 27762 bytes (86%) of program storage space. Maximum is 32256 bytes.



Global variables use 2775 bytes (135%) of dynamic memory, leaving **-727 bytes for local variables**. Maximum is 2048 bytes.

Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint.

Error compiling for board Arduino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I'll try the GxEPS2 example later today - as you did. Though I have a ESP32 knocking around that I may just use for the project.

Thanks for getting back and helping me out.

Okay, I get similar low memory threat with a dry compile for the UNO:

Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno"

Sketch uses 19496 bytes (60%) of program storage space. Maximum is 32256 bytes.

Global variables use 1676 bytes (81%) of dynamic memory, leaving 372 bytes for local variables. Maximum is 2048 bytes.

Low memory available, stability problems may occur.

Please note, that the code isn't perfect yet. It is very low power and that works super good. You can add other boards as well, but i'll change/upgrade the code later when I have the time.

You should use the example for AVR instead. Take another look at the link!

Yes, I will try GxEPS2 as I wrote further on,

"I'll try the GxEPS2 example later today - as you did. Though I have a ESP32 knocking around that I may just use for the project.

Thanks for getting back and helping me out."

I understand. You can't read. Nor write. I can't help.

I've been completely polite. Even thanked you a couple of times. Your suggestions were very helpful and I acknowledged that fact. I'm pointing out that I think you missed what I wrote in post #8 bottom, as you accused me in post number #9 of not reading your message telling me to, "take another look at the link!". Indeed I got what you had originally said and I just reiterated that fact in post #12. You take such a cold line with me in your last #13. Not sure what I did that upset you so much- I think you misinterpreted my replies and I did value your time, less valued your criticism of my literary competence.

(BTW, I seem to have made headway with GxEPS2 on the Uno no less).

Good day to you JM.