Arduino serial non-blocking
You are right: Serial.write() is non blocking: it puts the data in a
buffer and waits for an interrupt routine to send it through the UART.
If you want to wait for the transmission to complete, you can call
Serial.flush().