Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Pin =8;
- int ledPin = 13;
- void setup()
- {
- pinMode(Pin, INPUT);
- pinMode(ledPin, OUTPUT);
- }
- void loop()
- {
- if (digitalRead(Pin) == HIGH)
- {
- digitalWrite(ledPin, HIGH);
- }
- else
- {
- digitalWrite(ledPin, LOW);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement