MB 1013-000 (Maxbotix Ultrasonic Sensor)

Hey I am from team 6001 and we are wondering how to program the ultrasonic sensor in python.
We have been searching online and we have not been able to find the code. In addition to this, we have not been able to connect it. Thanks!

I can’t say directly how to use it in python, but in our experience (C++) the simplest way to use them is to wire it up to output an analog voltage and then read that voltage in the code and scale it by the factors described in the datasheet found here.

I think the formula for mm from voltage is something along the lines of this:

mm = ( Vcc / 1024 ) / 5

Where Vcc is the voltage you are running the sensor on (normally 5V for FRC use).

Then you can figure out the scaling from mm to inches or whatever unit you wish.