Advertisement
vencinachev

Arduino Exam

Jan 5th, 2019
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #define BUTTON 2
  2. #define LED 3
  3.  
  4. void setup() {
  5.   pinMode(BUTTON, INPUT);
  6.   pinMode(LED, OUTPUT);
  7. }
  8.  
  9. void loop() {
  10.   int button = digitalRead(BUTTON);
  11.   if (button == HIGH){
  12.     for (int i = 0; i < 10; i++){
  13.       digitalWrite(LED, HIGH);
  14.       delay(1000);
  15.       digitalWrite(LED, LOW);
  16.       delay(2000);
  17.     }
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement