Hey People,
so at the moment, i am working on a project which involves the Arduino Mega 2560.
I want to use the arduino to transfer pictures from my PC to an e-Paper display. In order to do this, i have to convert the image to a c-array, i have written some code for that, works fine.
The imagedata is stored in hex and each hex-number representes two pixels of the image.
Now, my problem is, that my Arduino Code wont compile because the array gets too big. RIght now i am trying to compile code for a 300x300 picture, which translates to 90.000 pixels and 45.000 hex-numbers. This does not work, although the Arduino Mega has more than enough RAM, so it must be a software (or brain) issue.
Does anyone have an idea, how i could work around it? The image is saved as a const unsigned char array.
Best Regards
#include <SPI.h>
#include "epd5in65f.h" //this is my library for the waveshare 5.56f display
#include "imagedata.h" //my header for the imagedata
void setup()
{
Serial.begin(115200);
Epd epd;
if (epd.Init() != 0)
{
Serial.print("e - Paper init failed");
return;
}
epd.Clear(EPD_5IN65F_WHITE);
epd.EPD_5IN65F_Display_part(image,0,0,300,300);
}
void loop() {}
My imagedata:
#include "imagedata.h"
#include <avr/pgmspace.h>
const unsigned char image[45000] PROGMEM =
{0x01,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11
,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11
,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11..........}