Same program from Arduino Uno R4 Wifi on Arduino Mega 2560

I will probably try going further with the R4, as it reads the needed data, and activate the 3rd serial according to: https://forum.arduino.cc/t/third-serial-port-on-uno-r4-serial2/1177436, so that Serial is left to connect PC, Serial1 is for the Pixhawk (as it works), leave software serial (as it works), and use Serial2 from the post in the link, to connect the Sonar (hopefully it will work).

I'll revive the post if, what i plan to do doesn't work.

Thank you all so far.