Hi again Rob!
I've been experimenting as you suggested but I've never been able to met the condition of the suggested block if (nosBytes == 9) (I tried values from 2 to 9) so I kept digging and added this at the end of the add() function:
Serial.print("> My nosBits = ");
Serial.println(nosBits);
Serial.print(">> My nosBytes = ");
Serial.println(nosBytes);
To see how nosBits where (generally) increasing OK from 0 to 7, but nosBytes just went form 0 to 1 (and sometimes 2) hence it would be never able to meet the condition.
I found out that most of the time this condition is meet:
if (digitalRead(RxPin) != tempBit) {
noErrors = false;
}
I believe this could be OK as we are waiting for the transition to happen?
And sometimes this one is also triggered:
if (headerHits < headerBits) {
noErrors = false;
}
So noErrors = false and then nosBytes goes back to 0 at the beginning of loop()
Do you have any clue of what could be the reasons for this to happen?
Once again, thank you!!
Javier