SHARE
TWEET

Untitled

a guest May 27th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define krM1 4000
  2. #define jelM1 2000
  3. #define zelM1 3000
  4. unsigned long time=0;
  5. byte state = 1;
  6. void setup()
  7. {
  8. pinMode(13, OUTPUT);
  9. pinMode(12, OUTPUT);
  10. pinMode(8, OUTPUT);
  11. digitalWrite(8, state);
  12. }
  13. void loop()
  14. {
  15. switch(state)
  16. {
  17. case 1:
  18. if(millis()-time>jelM1)
  19. {
  20. time=millis();
  21. digitalWrite(8, 1);
  22. digitalWrite(12,0);
  23. state=2;
  24. }
  25. break;
  26. case 2:
  27. if(millis()-time>krM1)
  28. {
  29. time=millis();
  30. digitalWrite(12,1);
  31. state=3;
  32. }
  33. break;
  34. case 3:
  35. if(millis()-time>jelM1)
  36. {
  37. time=millis();
  38. digitalWrite(8,0);
  39. digitalWrite(12,0);
  40. digitalWrite(13,1);
  41. state=4;
  42. }
  43. break;
  44. case 4:
  45. if(millis()-time>zelM1)
  46. {
  47. time=millis();
  48. digitalWrite(13,1);
  49. digitalWrite(8,0);
  50. digitalWrite(12,0);
  51. state=5;
  52. }
  53. break;
  54.  
  55. case 5:
  56. if(millis()-time>500)
  57. {
  58. time=millis();
  59. digitalWrite(13,0);
  60. state=6;
  61. }
  62. break;
  63. case 6:
  64. if(millis()-time>500)
  65. {
  66. time=millis();
  67. digitalWrite(13,1);
  68. state=7;
  69. }
  70. break;
  71. case 7:
  72. if(millis()-time>500)
  73. {
  74. time=millis();
  75. digitalWrite(13,0);
  76. state=8;
  77. }
  78. break;
  79. case 8:
  80. if(millis()-time>500)
  81. {
  82. time=millis();
  83. digitalWrite(13,1);
  84. state=9;
  85. }
  86. break;
  87. case 9:
  88. if(millis()-time>500)
  89. {
  90. time=millis();
  91. digitalWrite(13,0);
  92. state=10;
  93. }
  94. break;
  95. case 10:
  96. if(millis()-time>500)
  97. {
  98. time=millis();
  99. digitalWrite(13,1);
  100. state=11;
  101. }
  102. break;
  103. case 11:
  104. if(millis()-time>500)
  105. {
  106. time=millis();
  107. digitalWrite(13,0);
  108. digitalWrite(12,1);
  109. state=12;
  110. }
  111. break;
  112. case 12:
  113. if(millis()-time>jelM1)
  114. {
  115. time=millis();
  116. digitalWrite(12,1);
  117. state=1;
  118. }
  119. break;
  120. }
  121. delay(20);
  122. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top