# Advanced (Arduino)

A 3.3v Arduino can be connected to the IR Seeker as an I2C device. The sample code below will read the best sensor value and the signal strength of the board.

The IR Seeker feature switches should be set to:

1. Off
2. On

The pinout for I2C:

<figure><img src="/files/3QU2JqTFIHQTgji4bTU5" alt="" width="375"><figcaption></figcaption></figure>

```arduino
#include <Arduino.h>
#include <Wire.h>
                    
void setup() 
{  
    Wire.begin(); 
}
                
void loop() 
{    
    Wire.requestFrom(0x10 / 2, 2);
    while (Wire.available())    
    {     
        int c = Wire.read(); // direction is the first byte    
        Serial.print("Best Sensor is: ");    
        Serial.println(c);   
        //smaller number the closer the ball
        int strength = Wire.read(); 
        Serial.print("Strength is: ");    
        Serial.println(strength);          
    }  
    delay(250);
}
```

{% embed url="<https://youtu.be/UE-1PWVJN48>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://irseeker.buildingblockrobotics.com/guides/advanced-arduino.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
