1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
void rs485_tx(byte b) { Serial.print(b, BYTE); //read for our own byte. long now = millis(); long end = now + 10; int tmp = Serial.read(); while (tmp != b) { tmp = Serial.read(); if (millis() > tmp) break; } }