Arduino Obstacle Avoidance and Cliff Avoidance Robot

In the middle of your unsigned long ping() function you have the line unsigned long ping();

Are you doing something clever or is that line a mistake ?