Strange compiler error

Another thing is you've got two virtually identical ping functions.
Give one of them parameters for the pins, and lose the other one.