Advertisement
STANAANDREY

cont test

Mar 4th, 2023
803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. int led = 2;
  2. int pushButton = 12;
  3. void setup() {
  4.   pinMode(led, OUTPUT);
  5.   pinMode(pushButton, INPUT);
  6. }
  7.  
  8. // the loop function runs over and over again forever
  9. void loop() {
  10.   int state = digitalRead(pushButton);
  11.   if (state == HIGH) {
  12.     digitalWrite(led, HIGH);
  13.     delay(1000);
  14.     digitalWrite(led, LOW);
  15.     delay(1000);
  16.   }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement