Guest User

Untitled

a guest
Jul 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. void setup()
  2.  
  3. {
  4.  
  5. pinMode(2,INPUT);
  6.  
  7. pinMode(3,OUTPUT);
  8.  
  9. }
  10.  
  11. void loop()
  12.  
  13. {
  14.  
  15. if (digitalRead(2)==1)
  16.  
  17. {
  18.  
  19. digitalWrite(3,HIGH);                   #LED is on
  20.  
  21. }
  22.  
  23. else
  24.  
  25. {
  26.  
  27. digitalWrite(3,LOW);                      #LED is off
  28.  
  29. }
  30.  
  31. }
Add Comment
Please, Sign In to add comment