Advertisement
Guest User

arduu

a guest
Jul 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. void setup() {
  2. // initialize the LED pin as an output:
  3. pinMode(D5, OUTPUT);
  4. // initialize the pushbutton pin as an input:
  5. pinMode(D0, INPUT);
  6. }
  7.  
  8. void loop() {
  9.  
  10. // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  11. if (digitalRead(d0)== HIGH) {
  12. digitalWrite(D5, HIGH);
  13. } else {
  14. // turn LED off:
  15. digitalWrite(D5, LOW);
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement