aboda243
Published

Obstacle Detector using IR module - tutorial

Learn how to use IR module to detect obstacles!

BeginnerFull instructions provided195
Obstacle Detector using IR module - tutorial

Things used in this project

Story

Read more

Schematics

circuit:

Code

the code:

Arduino
#define IRpin 2
#define ledPin 13
void setup() {
  // put your setup code here, to run once:
pinMode(IRpin,INPUT);
pinMode(ledPin,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  int IRread = digitalRead(IRpin);
 digitalWrite(ledPin,LOW);
if(IRread == 0){
  digitalWrite(ledPin,HIGH);
}
}

Credits

aboda243
2 projects • 2 followers

Comments