Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. void setup() {
  2. // put your setup code here, to run once:
  3. pinMode(5, INPUT);
  4. pinMode(13, OUTPUT); //will use the built in led to show the result
  5.  
  6. }
  7.  
  8. void loop() {
  9. // put your main code here, to run repeatedly:
  10. power = digitalRead(5);
  11. if (power) {
  12. digitalWrite(13, HIGH);
  13. // do other things if you want
  14. }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement