Sharp Infrared Receiver (GP1UX311QS) [S016]



https://www.youtube.com/watch?v=21SB3fJBSLg



* Specs

Product GP1UX311QS

Make Sharp

Type None

Lead Time Request Quote for Lead Time

Quantity in Stock Request Quote for Quantity in Stock


* Contents

- Connect

GND ----- GND

VCC ----- 5V

S ----- 2

EN ----- X


- Key Code

int T = 2; // INPUT PIN

 

void setup()

{

 Serial.begin(115200);

 Serial.println("Arduino Examples - IR Sensor");

 Serial.println(" http://docs.whiteat.com/?p=1142");

 pinMode(T, INPUT);

}

 

void loop()

{

 if (LOW == digitalRead(T))

 {

 Serial.println("IR Detected"); // Detected

 }

 else

 {

 Serial.print("."); 

 }

 delay(100);

}

Posted by RDIoT
|