Advertisement
2607

button

Jul 18th, 2019
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int Pin =8;
  2. int ledPin = 13;
  3.  
  4. void setup()
  5. {
  6.   pinMode(Pin, INPUT);
  7.   pinMode(ledPin, OUTPUT);
  8. }
  9.  
  10. void loop()
  11. {
  12.   if (digitalRead(Pin) == HIGH)
  13.   {
  14.     digitalWrite(ledPin, HIGH);  
  15.   }
  16.   else
  17.   {
  18.     digitalWrite(ledPin, LOW);
  19.   }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement