Advertisement
MarVin666

Untitled

Sep 30th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. int LiczDio=0;
  2. int RodzL1=0, RodzL2=0, RodzL3=0;
  3. int WybranaDioda;
  4. int DiodaL1=0,DiodaL2=0,DiodaL3=0;
  5.  
  6. void Konfiguracja(){
  7.  
  8. if(!(przycisk2))
  9. WybranaDioda++;
  10. while(!(przycisk2));
  11.  
  12.  
  13. if(WybranaDioda%3==0){
  14. if(!(przycisk3))
  15. RodzL1++;
  16. while(!(przycisk3));
  17.  
  18. if(RodzL1%3==0){
  19. zapal(1);
  20. zgas(3);
  21. }
  22. if(RodzL1%3==1){
  23. zgas(1);
  24. zgas(3);
  25. }
  26. if(RodzL1%3==2){
  27. zgas(3);
  28. migaj(30000,1);
  29. }
  30. }
  31.  
  32. if(WybranaDioda%3==1){
  33. if(!(przycisk3))
  34. RodzL2++;
  35. while(!(przycisk3));
  36.  
  37. if(RodzL2%3==0){
  38. zapal(2);
  39. zgas(1);
  40. }
  41. if(RodzL2%3==1){
  42. zgas(2);
  43. zgas(1);
  44. }
  45. if(RodzL2%3==2){
  46. zgas(1);
  47. migaj(30000,2);
  48. }
  49. }
  50.  
  51. if(WybranaDioda%3==2){
  52. if(!(przycisk3))
  53. RodzL3++;
  54. while(!(przycisk3));
  55.  
  56. if(RodzL3%3==0){
  57. zapal(3);
  58. zgas(2);
  59. }
  60. if(RodzL3%3==1){
  61. zapal(3);
  62. zgas(2);
  63. }
  64. if(RodzL3%3==2){
  65. zgas(2);
  66. migaj(30000,3);
  67. }
  68. }
  69. }
  70.  
  71.  
  72. void Pracuj(){
  73.  
  74. if(!(przycisk2))
  75. DiodaL1++;
  76. while(!(przycisk2));
  77.  
  78. if(!(przycisk3))
  79. DiodaL2++;
  80. while(!(przycisk3));
  81.  
  82. if(!(przycisk4))
  83. DiodaL3++;
  84. while(!(przycisk4));
  85.  
  86. if(DiodaL1%2==0){
  87. if(RodzL1%3==0)
  88. zapal(1);
  89. if(RodzL1%3==1)
  90. zgas(1);
  91. if(RodzL1%3==2)
  92. migaj(30000,1);
  93. }
  94. else
  95. zgas(1);
  96.  
  97. if(DiodaL2%2==0){
  98. if(RodzL2%3==0)
  99. zapal(2);
  100. if(RodzL2%3==1)
  101. zgas(2);
  102. if(RodzL2%3==2)
  103. migaj(30000,2);
  104. }
  105. else
  106. zgas(2);
  107.  
  108. if(DiodaL3%2==0){
  109. if(RodzL3%3==0)
  110. zapal(3);
  111. if(RodzL3%3==1)
  112. zgas(3);
  113. if(RodzL3%3==2)
  114. migaj(30000,3);
  115. }
  116. else
  117. zgas(3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement