Is471Fe

Hello,to evryone I have arduino from 2 days and I am like crazy at home. :slight_smile: I have the above sensor IS471FE I wrote a code and it's work's well,but mine question to the audience is the following:
Is there a way to program the arduino and the sensor to activete the code I wan't in the smallest detect Ir light.(It's hard to explain ;))

I'm not sure I understand. That is a sensor that will respond to a light source (LED) clocked off of pin 4 GL output. You an LED at 940 nanometers, an IR LED. You will need to connect the diode to the chip as shown in FIG 4 of the data sheet. You will need to run the V0 pin to the arduino. When the LED turns on with the GL output and there is nothing blocking the sensor V0 will respond. If there is something blocking it V0 will not respond. In this way you hae an optical switch.

V0 will be a LOW when the sensor detects the LED and a HIGH when blocked.

You must only use +5V to power this with the arduino. You need a 0.33uf capacitor at 5V and it seems a 280 ohm pullup on GL.

Man I already did the schematic and write a code I just ask is there a way for more quick response,because sometimes the sensor don't detect fast the object and the platform smash it.

Anybody

Man I already did the schematic and write a code

So man show us like.

Ok that is the code:

const int sharpPin = 2;
const int sharpPin2 = 4; 
const int ledPin =  13;
const int motorPin1 = 11;
const int motorPin2 = 10;

int sharpState = 0;   
int sharpState2 = 0; 

void setup() {
  Serial.begin(9600);
  pinMode (motorPin1, OUTPUT);
  pinMode (motorPin2, OUTPUT);
  pinMode(ledPin, OUTPUT);      
  pinMode(sharpPin, INPUT);
  pinMode(sharpPin2, INPUT);  
}

void loop(){
  sharpState = digitalRead(sharpPin);
  sharpState2 = digitalRead(sharpPin2);

  if (sharpState == LOW) { 
    analogWrite(motorPin2, LOW);    
    // turn LED on:    
    digitalWrite(ledPin, HIGH);  
    
  } 
  else {
    delay(200);
    analogWrite(motorPin2, 100);
    // turn LED off:
    digitalWrite(ledPin, LOW); 
  }
   if (sharpState2 == LOW) {
    digitalWrite (motorPin1, LOW);     
    // turn LED on:    
    digitalWrite(ledPin, HIGH);  
  } 
  else {
    delay(200);
    analogWrite(motorPin1, 100);
    // turn LED off:
    digitalWrite(ledPin, LOW); 
  }
}

Soon I will add l293 integral circuit,to control the motors in both directions.
Now the motors are controled via 2N3904 (work like a switch.)