> For the complete documentation index, see [llms.txt](https://guides.mccaskeyrobotics.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.mccaskeyrobotics.org/ftc/sensors/mr-ultrasonic-range-sensor.md).

# MR Ultrasonic Range Sensor

### Part 1: Plugging in Your Range Sensor

### Part 2: Configuring Your Sensor

![](https://3423273789-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjRgHmD322MUgRPOyqMLh%2Fuploads%2Fgit-blob-74bf8b6a52c1062cee0aab554234a4385276cee0%2Fimage3?alt=media)

![](https://3423273789-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjRgHmD322MUgRPOyqMLh%2Fuploads%2Fgit-blob-0a4cd8bd95e207b7c3d28769157568052b5e9bce%2Fimage5?alt=media)

Choose an open I2C port Choose MR Range Sensor Name it “sensor\_range”Part 3: Running Test OpMode

\- Create a new file with the below settings:

![](https://3423273789-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjRgHmD322MUgRPOyqMLh%2Fuploads%2Fgit-blob-0a55b1b07bc56a79c18fcb395c5c67a3ad55fceb%2Fimage4?alt=media)

\- Build everything and run your opMode by selecting it on your driver’s station.

\- Move your hand back and forth in front of your range sensor, noting what kind of values you get.

\- Of the functions you can use, I find rangeSensor.rawUltrasonic() to be the most useful. Moving forward, we will combine this code with some while loops and if statements to accurately navigate the field.

\- For seeing objects that are super close to you (inside 5 cm) , it may also be useful to use the rangeSensor.cmOptical() function.
