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

#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);
}

Last updated