i have connected 4 ping sensor to my arduino uno and i want to know if any one can help me with a schetch for my 4 sensors were they show in the same serial monitor individuality the messuerments.
I don't think the 250 millisecond (1/4 second) delays are absolutely necessary; 5 milliseconds should suffice (and even that might be overkill). You could potentially do a ping, serial print, then ping another, serial print - and the serial prints would take care of any delay needed (if any is really needed).
Other than that, I made the pin definitions #defines, and created a single function for the ping action; potentially, the return values on the ping() and microsecondsToCentimeters() could be ints instead of longs, with some conversion/casting done to make sure of type (or something could be done with floats, so that you could get back fractional values).
I'm just posting these changes to allow others, and perhaps yourself, understand how by consolidation of functional definitions into as few functions as possible can lead to better code reuse, cleaner code, and a more maintainable structure overall.
Thank you very much, i will try the code's to see wich one works the best and post the answer so maby other people don't have the same prb as me. Thank you again !