add ping sensor functions
fix compile errors