Product | Brick | Button Switch Brick | Digital IR Switch-100cm
Digital IR Switch-100cm
Digital IR Switch-100cm
41842
 
US$9.58 Loading ...
 
Share/Save/Bookmark
                       
Digital IR Switch-100cm

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 100cm
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);
  }
}





Write a review
*Review title
Please enter subject.
*Your review
Please enter review.
*Rating
(Click star icon to comment)
 
Display name
Loading ...
Best Sellers
Newsletter

Join our newsletter today, to get latest product information and promotion code.

Join
Loading ...