Fix ping sensor code