@ZinggJM
Sry I forgot to mention that I use a Arduino Pro Mini 3.3V.
You are right with h=10, I changed this already.
Today I changed my code a bit, now I have picture on my display, it's only a little bit shifted
I'm using the drawImage() method, because the writeImage() and refresh() method is already included there. Would I have any advantages to use drawImage(), refresh(), writeImageAgain(), refresh() ,... instead of drawImage()?
EDIT: I uploaded a picture of the screen and the source picture.
EDIT2: After adding a delay(1000) after each refresh, its now working like it should! Thanks!
EDIT3: It seems like it didn't solved the problem 100%, like every third picture transfer is shifted.
#define ENABLE_GxEPD2_GFX 0
#include <GxEPD2_BW.h>
#include <GxEPD2_3C.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#if defined(__AVR)
#define MAX_DISPAY_BUFFER_SIZE 800 //
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPAY_BUFFER_SIZE / (EPD::WIDTH / 8))
GxEPD2_BW<GxEPD2_213, MAX_HEIGHT(GxEPD2_213)> display(GxEPD2_213(/*CS=10*/ SS, /*DC=*/8, /*RST=*/9, /*BUSY=*/7)); // GDE0213B1, phased out
#endif
#include "GxEPD2_boards_added.h"
#if !defined(__AVR) && !defined(_BOARD_GENERIC_STM32F103C_H_)
#include "bitmaps/Bitmaps128x250.h" // 2.13" b/w
#else
#include "bitmaps/Bitmaps128x250.h" // 2.13" b/w
#endif
#include <SoftwareSerial.h>
SoftwareSerial altSerial(4, 3); // RX, TX
char bytes[160];
void setup()
{
display.init(115200);
altSerial.begin(115200);
receive();
display.drawImage(bytes, 0, 0, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 10, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 20, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 30, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 40, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 50, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 60, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 70, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 80, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 90, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 100, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 110, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 120, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 130, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 140, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 150, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 160, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 170, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 180, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 190, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 200, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 210, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 220, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 230, 128, 10, false, true, false);
receive();
display.drawImage(bytes, 0, 240, 128, 10, false, true, false);
display.powerOff();
}
void loop()
{
}
void receive()
{
int i = 0;
while (i < 160)
{
if (altSerial.available())
{
bytes[i] = altSerial.read();
Serial.println(bytes[i], DEC);
i++;
}
}
}