> 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/fusion/ir-360-locator.md).

# IR 360 Locator

![Gather the parts above. The hardware is all 6-32. ](/files/sn1qUqMqTp8ShU35sUKh)

![Attach standoffs from bottom](/files/EACSbGjEZxDp7vEoa1V5) ![Attach sensor to the top.](/files/9zCDlcMYIfpXUp5oJGtp) ![Plug sensor into the I2C ports... make sure the black wire is on the black side. ](/files/cm9YSqn9Y54x9g3L5oer)

{% embed url="<https://docs.google.com/presentation/d/1PIDC5-qEMtaJw_AV_xwqjoFFHQoG97u4k29PQJQF7Zs/edit?usp=sharing>" %}

![IR Beacon](https://modernroboticsinc.com/wp-content/uploads/2019/03/0001365_360-ir-beacon.jpeg)

### Reading the values

```python
import Fusion

# Class definitions -----------------------------------------------------------
f = Fusion.driver()
l = Fusion.locator360(f)

# Program Start ---------------------------------------------------------------
while True:
    print ("Heading   = " + str(l.getHeading(1200)))
    print ("Intensity = " + str(l.getIntensity(1200)))
    print("") 
    f.delay(0.25)

```

### Navigating to the goal

<pre class="language-python"><code class="lang-python">import Fusion

# Object definitions -----------------------------------------------------------
f = Fusion.driver()
l = Fusion.locator360(f)

#while we are close to the beacon, straight away from it...
while (l.getIntensity(1200) > 50):
# the sensor will have a heading of 35 when it is 
## pointing 180 degrees away from the beacon
    if(l.getHeading(1200) &#x3C; 34):
        #turn counterclockwise
        f.motorSpeed(f.M0, 30)
        f.motorSpeed(f.M1, -30)
    elif(l.getHeading(1200) > 36):
        #turn clockwise
        f.motorSpeed(f.M0, -30)
        f.motorSpeed(f.M1, 30)
    else:
        #straight
        f.motorSpeed(f.M0, 50)
        f.motorSpeed(f.M1, 50)
        
<strong>#stop the robot now that we are far enough away        
</strong>f.motorSpeed(f.M0, 0)
f.motorSpeed(f.M1, 0)
#shoot the ball!
</code></pre>
