Pages: [1]   Go Down
Author Topic: Adjustable Infrared Sensor Switch (SKU:SEN0019)  (Read 733 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
who did use this sensor
How we could tune it.  I try to read input.  But never goes to high

Thx
Max
Logged

Madrid,Spain
Offline Offline
Newbie
*
Karma: 4
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

did u tried this?
Code:
const int InfraredSensorPin = 4;//Connect the signal pin to the digital pin 4 >> yellow
const int LedDisp = 13;

void setup()
{
  Serial.begin(57600);
  Serial.println("Start!"); 
  pinMode(InfraredSensorPin,INPUT);
  pinMode(LedDisp,OUTPUT);
  digitalWrite(LedDisp,LOW);
}

void loop()
{
  if(digitalRead(InfraredSensorPin) == LOW)  digitalWrite(LedDisp,HIGH);
  else  digitalWrite(LedDisp,LOW);
  Serial.print("Infrared Switch Status:");
  Serial.println(digitalRead(InfraredSensorPin),BIN);
  delay(50);
}




    Red - V+
    Yellow - Signal
    Green - GND
    detection range is 3cm - 80cm
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes I tried that but without LED

Logged

Pages: [1]   Go Up
Jump to: