Collision Avoidance Vehicle

Could you give me an example?
Not too familiar with how to use pulseIn