Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int led = 2;
- int pushButton = 12;
- void setup() {
- pinMode(led, OUTPUT);
- pinMode(pushButton, INPUT);
- }
- // the loop function runs over and over again forever
- void loop() {
- int state = digitalRead(pushButton);
- if (state == HIGH) {
- digitalWrite(led, HIGH);
- delay(1000);
- digitalWrite(led, LOW);
- delay(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement