Copy and paste did not work because of the squares you can see in the picture. I have tried it several times!
No!? I am not mixing print and write. Write I use for sending the data in bytes to the other Arduino (Master) and print I have used to show it on the serial monitor as readable text to see it better for comparison.
This with the String variable I have tried to understand, but have no idea how to change that or make it with another thing. Can you help me please?
I am not really sure if it is meant this way to go with the c string example:
const byte bufferSize {10};
char serialBuffer[bufferSize+1] {""};
...
...
void command(serialBuffer) {
memset(serialBuffer, 0, sizeof serialBuffer);
sendToUART(serialBuffer);
}
void sendToUART (buffer)
{
const size_t characters {strlen(buffer)};
Serial.print("laenge: "); Serial.println(characters);
for(byte index = 0; index < characters; index++){ //create the checksum for the array data[i] with 0 <= i <= 3
crc16(buffer[index]); //call the function crc16
}
...
...