Digital IR Switch for Arduino-100cm

$11.00
  • Units in Stock: 17
  • Date Added: Thursday 04 March, 2010
Add to Cart:

Product Description:

This module can be used with Arduino Special Sensor Shield V4.0.
You can do some simple design about it, "plug and play".

Arduino Digital IR Switch can detect things around 50-100cm.
the transmitter and the receiver all in one.


It adopts three cable interfaces,which is compatible with Sensor shield V4.
form up to down are : black(GND), red (V power), and blue (s signal)

connect with the sensor shield correctly.



if there is something going across the Arduino Digital IR Switch, you can detect by reading the Arduino
I/O.
(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);
  }
}
Qty Discounts Off Price
1-4
$11.00
5-9
$9.13
10-49
$8.25
50+
$6.60
Copyright © 2013 Elechouse.
Powered by ELECHOUSE