IRSeeker
  • IR Seeker
  • Guides
    • Spike Prime
      • PyBricks
      • Spike V3 Sample
      • Two Wheeled Robot
    • EV3
    • Advanced (Arduino)
  • Updates
    • Firmware
    • Latest Version
  • Board Overview
    • Board Feature Switches
    • SPIKE V3
    • Using the Building Holes
    • Installing EV3 Blocks
  • Previous Boards
    • Version 2
    • Version 1
  • Board Update
Powered by GitBook
On this page
  1. Guides

Advanced (Arduino)

PreviousEV3NextFirmware

Last updated 5 months ago

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:

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