After testing, changed approach and made modifications. readPing(), setServo(), and initServo() have now all been successfully tested on a Raspberry Pi.