Auto baud rate arduino

hello, is there any code that able the arduino MKRZRO to auto detect/change the baud rate of the UART1 depending on the baud rate of the other electronic card that is connected to the arduino?

See here;

yes it's me, but i wanted to make the question easier to understand here