Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
DIY Projects
Published © CC BY

How to use IR sensor with Arduino? (With full code) || Bihar

Hello Friends, In this video How to use IR sensor with Arduino? (With full code)

BeginnerShowcase (no instructions)1 hour72,256
How to use IR sensor with Arduino? (With full code) || Bihar

Things used in this project

Story

Read more

Schematics

Daigram

Code

Arduino code

C/C++
// BIHARI LIFEHACKER
void setup()
{
  pinMode(13,OUTPUT);
  pinMode(3,INPUT);
  Serial.begin(9600);
}
void loop()
{
  if (digitalRead(3)== LOW)
  {
    digitalWrite(13,HIGH);
    
    delay(10);
  }
  else 
  {
    
    digitalWrite(13,LOW);
    delay(10);
    
  }
  
}

Credits

DIY Projects
11 projects • 21 followers
Student

Comments