Sonar returns weird value

Hey all,
I’m having an issue with the sonar sensor on our robot. We are using the V5 system. When I first plugged it in and used it in our autonomous routine yesterday, it worked perfectly fine, returning values that made sense. Now today the sensor does not return anything but -0.039370. Any advice for what could be happening?

My advice would be to check for any damage to the sonar or the wires, also try a new port

Check the mesh in front of the sensor. We had the same issue and mesh was torn up which threw off the sensor values.

Most likely its damage to the sonar. If the little “eyes” at the front have been moved or damaged in some way, they won’t return proper values.
On the other hand, in RobotC the sonar returns -1 if it can’t find anything, which includes something being right in front of the sensor (or if the sonar thinks there’s something right in front of it)

yea, that looks like the sonar is returning -1 (invalid reading) and we are converting to inches. I should probably check for that and leave as -1.

Ok, thanks everyone. It does seem to be some sort of dead zone, so I’ll add another condition to my code to check for it.