We are using a Rev 2m distance sensor via the 12c port. The sensor reads correctly sometimes, but sometimes it reads -1 unless something is at a really close distance. This seems to happen when the battery is super low, but sometimes it happens when the battery is full.
We’ve tried multiple sensors and cables to make sure it wasn’t the sensor itself.
Is it possible the sensor is underpowered? Its says it needs 3.3v - 5v and the I2C says it provides 3.5v i believe.
Any help on this matter would be greatly appreciated!
I do not know if this is the case, but there are some devices that might return a certain value by default. Not sure what it is for I2C though. It could be that the device is missing/not found.
It works most of the time, but periodically it will only read within a few inches. Sometimes not at all. The value it gives when it isn’t working is -1.