360 IR Locator

360 IR Navigation

Part 1: The Sensor

- Plug the sensor in like this:

Or with REV Stuff…

- Configure your sensor as an I2C Device and name it “irl”

Part 2: Testing the Sensor

- You will need to build TWO programs to make this work… one is a class to handle setting up the sensor and the other is the actual OpMode. First, the class…

- Add a new class and call it MRIIrLocator. Don’t use an example file. Once you have added the class, delete everything inside it and copy/paste the code below.

Now build everything and run your Locator_Test OpMode. Take some time to understand how your sensor responds to your beacon.

Part 3: Navigating to the Sensor

You should now begin to add your motors to the Locator_Test file right inside your main class area…

Next, complete hardware mapping to tell your robot controller where to find your motors…(feel free to copy/paste this in from other files!)

Your main loop should look like this:

Now run the OpMode with a beacon placed on the floor somewhere in the room. Your robot should be able to find the beacon even if you start it facing the other direction.

Last updated

Was this helpful?