Advertisement
dusanrs

zadatak11

May 19th, 2022
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<arduinoPlatform.h>
  2. #include<tasks.h>
  3. #include<interrupts.h>
  4. #include<stdio.h>
  5. #include<serial.h>
  6. #include<pwm.h>
  7.  
  8. extern serial Serial;
  9.  
  10.  
  11. #define ld8 33
  12. #define ld2 27
  13. #define sw2 7
  14.  
  15. void setup()
  16. {
  17. pinMode(ld8,OUTPUT);
  18. pinMode(ld2,OUTPUT);
  19. pinMode(sw2,INPUT);
  20.  
  21.  
  22.  Serial.begin(9600);
  23. }
  24.  
  25. void loop()
  26. {
  27.     digitalWrite(ld8,LOW);
  28.     delay(1000);
  29.     digitalWrite(ld8,HIGH);
  30.     delay(1000);
  31.  
  32.     if(digitalRead(sw2)==HIGH) digitalWrite(ld2,HIGH);
  33.     else digitalWrite(ld2,LOW);
  34.  
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement