Connecting Maxbotix LV-MaxSonar-EZ1 to roborio

Hi all,
I’ve been looking into different types of rangefinders and came across the Maxbotix LV-MaxSonar-EZ1.
The page about this sensor in WPIlib docs doesn’t explain how to connect it to the RoboRIO (I figured through the analog input pins).
Can someone please explain how the sensor is connected to the RoboRIO?
Thanks!

Here are two options to hook the sensor up to the roboRIO:

Analog -

  • GND
  • +5
  • AN (to signal pin)

Digital (DIO) -

  • GND
  • +5
  • PW (to signal pin)

Thanks!
btw, it’s an analog input object in java, right?

It’s an analog input when you connect it to the Analog pins.

If I put it on DIO port 3, what is the procedure in Java to declare this sensor? The Ultrasonic class constructor requires two ports: the ping channel and the echo channel. This sensor only has one port.

I’m not a programmer.

The sensor delivers a number. It handles the ping and echo stuff by itself. So read in the number, do the math to change that into whatever distance units you want (inches, centimeters, furlongs, etc.) and go.

The ultrasonic class is not right because the sensor is integrated, as opposed to an ultrasonic transponder which needs to be told when to ping and then the controller needs to listen for the echo to calculate distance.

How do you get it to read in inches in labview? I’ve tried changing it and the reading I keep getting is I believe in cm

Divide by 2.54