mstoyanov7

lampa

Oct 18th, 2021
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. int ledState = 0;
  2.  
  3. void loop() {
  4.     if (digitalRead(button) == 1) {
  5.         if (ledState == 0) {            
  6.             ledState = 1;                  
  7.             digitalWrite(led, 1);    
  8.         }                            
  9.         else {                        
  10.             ledflag = 0;                  
  11.             digitalWrite(led, 0);      
  12.         }
  13.         delay(1000);                    
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment