But your sending order is different from your receiving order! How do you expect this to work?
Serial.find cannot search backwards. It can only search in forward direction. Your sender sends data in
ABCDE<>HOP order. In receiver code you do this
if (Serial.find('E')) weight = Serial.parseInt();
if (Serial.find('P')) CRC_recv = Serial.parseInt();
if (Serial.find('H')) gas = Serial.parseInt();
Once you’ve called
Serial.find('P'), you have skipped (and lost forever) all data that was stored between
P. You skipped
<>HO part. There’s no way to return to that data afterwards. So the next
Serial.find('H') will not find the
H that you already skipped. It will grab for the
H from the next data package (skipping everything else) or simply timeout.
If you want to use that
Serial.find technique in your receiver, and your sender sends data in
ABCDE<>HOP order, then you will have to do
Serial.find in exactly this order. Any deviations from this order, and your
Serial.find approach will start skipping values.
Also, why is your
> tags mapped to different values? On the sending side
okunan_sut. On the receiving side