Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- // initialize the LED pin as an output:
- pinMode(D5, OUTPUT);
- // initialize the pushbutton pin as an input:
- pinMode(D0, INPUT);
- }
- void loop() {
- // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
- if (digitalRead(d0)== HIGH) {
- digitalWrite(D5, HIGH);
- } else {
- // turn LED off:
- digitalWrite(D5, LOW);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement