Arduino Digital IR Switch-10cm
It is very interesting Electronic Brick Module-7
This module can be used with Arduino Special Sensor Shield V4.0.
Arduino Digital IR Switch can detect things around 10cm
This module can be used with Arduino Special Sensor Shield V4.0.
You can do some simple design about it,it support“plug and play”。
the transmitter and the receiver all in one.
It adopt three cable interfaces,which is compatible with Arduino Special Sensor Shield V4.0.
form up to down are : GND(black)、power(V red)、and signal(S blue)
When connect with the sensor shield , link the wire correctly 
if there is something going across the Arduino Digital IR Switch , then you can read the Arduino
I/O to finish the detect.
(the value should be low when something going across)
the Arduino code is :
int ledPin = 13;
int switchPin = 8;
int value = 0;
void setup() {
pinMode(switchPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
value = digitalRead(switchPin);
if (HIGH == value) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
}
Join our newsletter today, to get latest product information and promotion code.








