PING sensor 3pins and 4 pins

I want to know how can I translate a 4pins code to a 3pins code, I have 1 day using the arduino.

The four pin units usually have one pin for the trigger (output from the microcontroller) and one pin for the echo (input to the microcontroller).

With the three pin units, you have to change the pinMode from output to input after triggering, and then back to output ready for the next ping.