Infrared proximity testing using arduino
void setup() {
pinMode(A3,OUTPUT);
pinMode(A5,INPUT_PULLUP);
pinMode(13,OUTPUT);
pinMode(A4,OUTPUT);
digitalWrite(A3,HIGH);
digitalWrite(A4,LOW);
digitalWrite(13,LOW);
delay(1000);
}
void loop() {
if(digitalRead(A5)==HIGH)
{
digitalWrite(13,LOW);
}
else
{
digitalWrite(13,HIGH);
delay(1000);
}
}
0 Comments