youeyg96:
This is the full code with example 3 from Robin2 integrated into it
You have added a huge amount of code into my recvWithStartEndMarkers() function. Don't do that. Leave my function unchanged and put your code in its own function and call it from loop() whenever newData == true. Something like this
void loop() {
recvWithStartEndMarkers();
if (newData == true) {
doMyStuff();
newData = false;
}
}
If you ensure that each function just has a single purpose it is easy to test each of them separately. See Planning and Implementing a Program
...R