Advertisement
Shekhar777

IR 1LED sensor

Mar 8th, 2021
964
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. void setup() {
  2.   pinMode(12,OUTPUT);
  3.    pinMode(8,INPUT);
  4.  
  5. }
  6. void loop() {
  7.  if (digitalRead(8)== HIGH)
  8.  {
  9.  
  10.    digitalWrite(12,HIGH);
  11.    delay(500);}
  12. else
  13. {  digitalWrite(12,LOW);
  14.  delay(500);
  15.  
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement