Your sketch is missing a critical line:
duration = pulseIn(pingEcho, HIGH, 30000);
Since you never measure the HIGH pulse duration on the 'pingEcho' pin, you have no way to calculate the distance.
Your sketch is missing a critical line:
duration = pulseIn(pingEcho, HIGH, 30000);
Since you never measure the HIGH pulse duration on the 'pingEcho' pin, you have no way to calculate the distance.