Guest User

Untitled

a guest
Jan 23rd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 17.49 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <util/delay.h>
  3. #include <avr/io.h>
  4. #include <math.h>
  5. #include <stdint.h>
  6.  
  7. #define F_CPU 1000000UL
  8.  
  9. #define CZERWONA 1
  10. #define ZOLTA 2
  11. #define ZIELONA 3
  12. #define STRZALKA 4
  13.  
  14. #define ZAPAL 0x07
  15. #define ZGAS 0x06
  16.  
  17. #define CLK0 0x04
  18.  
  19. #define CZAS_MIGANIA 5000
  20.  
  21. void zapalanie(void)
  22. {
  23.    PORTB=ZAPAL;
  24.    PORTB=CLK0;
  25. }
  26.  
  27. void gaszenie(void)
  28. {
  29.    PORTB=ZGAS;
  30.    PORTB=CLK0;
  31. }
  32.  
  33. void etap1(void);
  34. void etap1a(void);
  35. void etap1b(void);
  36. void etap1c(void);
  37.  
  38. void etap2(void);
  39. void etap2a(void);
  40. void etap2b(void);
  41. void etap2c(void);
  42.  
  43. void etap3(void);
  44. void etap3a(void);
  45. void etap3b(void);
  46. void etap3c(void);
  47.  
  48. void etap4(void);
  49. void etap4a(void);
  50. void etap4b(void);
  51. void etap4c(void);
  52.  
  53. void reset(void);
  54.  
  55. int i=0;
  56. int j=0;
  57. int ledy[48]={1,2,3,4,
  58.             1,3,
  59.             3,1,
  60.             1,2,3,4,
  61.             1,3,
  62.             3,1,
  63.             1,2,3,4,
  64.             1,3,
  65.             1,3,
  66.             1,3,
  67.             3,1,
  68.             3,2,1,
  69.             0,
  70.             1,2,3,4,
  71.             1,3,
  72.             1,3,
  73.             0,
  74.             1,3,
  75.             3,1,
  76.             3,2,1};
  77.  
  78.  
  79. void reset(void)
  80. {
  81.    for (i=0; i<48; i++)
  82.    {
  83.       PORTB=0x3E;
  84.       PORTB=0x3C;
  85.    }
  86. }
  87.  
  88. void zolte(void)
  89. {
  90.    for (i=47; i>=0; i--)
  91.    {
  92.       if (ledy[i]==ZOLTA)
  93.       {
  94.          PORTB=ZAPAL;
  95.          PORTB=CLK0;
  96.       }
  97.       else
  98.       {
  99.          PORTB=ZGAS;
  100.          PORTB=CLK0;
  101.       }
  102.    }
  103. }
  104.  
  105. int stan=0;
  106.  
  107. void przycisk(void)
  108. {
  109.    int przycisk=PINB;
  110.    if ((przycisk&0x80)==0)
  111.       {
  112.       stan=1;
  113.       }
  114.    if ((przycisk&0x40)==0)
  115.       {
  116.       stan=0;
  117.       }
  118. }
  119.  
  120. //----------------------------------------------------------------------------------------------------------
  121. // etap 1 - góra i lewo
  122. void etap1(void)
  123. {
  124.    for (i=47; i>=0; i--)
  125.    {
  126.       if (i==5 || i==6 || i==21 || i==23 || i==34 || i==42 || i==43 || i==45) //światła zielone
  127.       {
  128.          PORTB=ZAPAL;
  129.          PORTB=CLK0;
  130.       }
  131.       else if (i==0 || i==8 || i==12 || i==15 || i==16 || i==24 || i==27 || i==30 || i==38 || i==44 || i==36) //światła czerwone
  132.       {
  133.          PORTB=ZAPAL;
  134.          PORTB=CLK0;
  135.       }
  136.       else if (i==3 || i==11) //strzałki
  137.       {
  138.          PORTB=ZAPAL;
  139.          PORTB=CLK0;
  140.       }
  141.       else
  142.       {
  143.          PORTB=ZGAS;
  144.          PORTB=CLK0;
  145.       }
  146.    }
  147. }
  148. // etap 1a - mruganie świateł na przejściu dla pieszych
  149. void etap1a(void)
  150. {
  151.    for (j=0; j<2; j++)
  152.    {
  153.       for (i=47; i>=0; i--)
  154.       {
  155.          if (i==5 || i==6 || i==34 || i==45) //światła zielone
  156.          {
  157.             PORTB=ZAPAL;
  158.             PORTB=CLK0;
  159.          }
  160.          else if (i==0 || i==8 || i==12 || i==15 || i==16 || i==24 || i==27 || i==30 || i==38 || i==36) //światła czerwone
  161.          {
  162.             PORTB=ZAPAL;
  163.             PORTB=CLK0;
  164.          }
  165.          else if (i==3 || i==11) //strzałki
  166.          {
  167.             PORTB=ZAPAL;
  168.             PORTB=CLK0;
  169.          }
  170.          else
  171.          {
  172.             PORTB=ZGAS;
  173.             PORTB=CLK0;
  174.          }
  175.       }
  176.    _delay_ms(3000);
  177.    reset();
  178.    etap1();
  179.    _delay_ms(3000);
  180.    reset();
  181.    }
  182. }
  183. // etap 1b - czerwone na przejściu dla pieszych i żółte na skręcie w lewo
  184. void etap1b(void)
  185. {
  186.    for (i=47; i>=0; i--)
  187.    {
  188.       if (i==5 || i==6 || i==34) //światła zielone
  189.       {
  190.          PORTB=ZAPAL;
  191.          PORTB=CLK0;
  192.       }
  193.       else if (i==0 || i==8 || i==12 || i==15 || i==16 || i==24 || i==27 || i==30 || i==38 || i==44 || i==36 || i==20 || i==22 || i==41) //światła czerwone
  194.       {
  195.          PORTB=ZAPAL;
  196.          PORTB=CLK0;
  197.       }
  198.       else if (i==3 || i==11) //strzałki
  199.       {
  200.          PORTB=ZAPAL;
  201.          PORTB=CLK0;
  202.       }
  203.       else if (i==46) // pomarańczowe
  204.       {
  205.          PORTB=ZAPAL;
  206.          PORTB=CLK0;
  207.       }
  208.       else
  209.       {
  210.          PORTB=ZGAS;
  211.          PORTB=CLK0;
  212.       }
  213.    }
  214. }
  215. // etap 1c - czerwone na przejściu dla pieszych, na skręcie w lewo; start w dół (czerwone+żółte)
  216. void etap1c(void)
  217. {
  218.    for (i=47; i>=0; i--)
  219.    {
  220.       if (i==5 || i==6 || i==34) //światła zielone
  221.       {
  222.          PORTB=ZAPAL;
  223.          PORTB=CLK0;
  224.       }
  225.       else if (i==0 || i==8 || i==12 || i==15 || i==16 || i==24 || i==27 || i==30 || i==38 || i==44 || i==20 || i==22 || i==47 || i==41 || i==36) //światła czerwone
  226.       {
  227.          PORTB=ZAPAL;
  228.          PORTB=CLK0;
  229.       }
  230.       else if (i==3 || i==11) //strzałki
  231.       {
  232.          PORTB=ZAPAL;
  233.          PORTB=CLK0;
  234.       }
  235.       else if (i==17) // pomarańczowe
  236.       {
  237.          PORTB=ZAPAL;
  238.          PORTB=CLK0;
  239.       }
  240.       else
  241.       {
  242.          PORTB=ZGAS;
  243.          PORTB=CLK0;
  244.       }
  245.    }
  246. }
  247.  
  248. //----------------------------------------------------------------------------------------------------------
  249. // etap 2 - góra i dół
  250. void etap2(void)
  251. {
  252.    for (i=47; i>=0; i--)
  253.    {
  254.       if (i==5 || i==6 || i==13 || i==14 || i==18 || i==34) //światła zielone
  255.       {
  256.          PORTB=ZAPAL;
  257.          PORTB=CLK0;
  258.       }
  259.       else if (i==0 || i==8 || i==20 || i==22 || i==24 || i==27 || i==30 || i==38 || i==44 || i==47 || i==41 || i==36) //światła czerwone
  260.       {
  261.          PORTB=ZAPAL;
  262.          PORTB=CLK0;
  263.       }
  264.       else if (i==3 || i==11) //strzałki
  265.       {
  266.          PORTB=ZAPAL;
  267.          PORTB=CLK0;
  268.       }
  269.       else
  270.       {
  271.          PORTB=ZGAS;
  272.          PORTB=CLK0;
  273.       }
  274.    }
  275. }
  276. // etap 2a - mruganie świateł na przejściu dla pieszych
  277. void etap2a(void)
  278. {
  279.    for (j=0; j<2; j++)
  280.    {
  281.       for (i=47; i>=0; i--)
  282.       {
  283.          if (i==13 || i==14 || i==18 || i==34) //światła zielone
  284.          {
  285.             PORTB=ZAPAL;
  286.             PORTB=CLK0;
  287.          }
  288.          else if (i==0 || i==8 || i==20 || i==22 || i==24 || i==27 || i==30 || i==38 || i==44 || i==47 || i==41 || i==38 || i==36) //światła czerwone
  289.          {
  290.             PORTB=ZAPAL;
  291.             PORTB=CLK0;
  292.          }
  293.          else if (i==3 || i==11) //strzałki
  294.          {
  295.             PORTB=ZAPAL;
  296.             PORTB=CLK0;
  297.          }
  298.          else
  299.          {
  300.             PORTB=ZGAS;
  301.             PORTB=CLK0;
  302.          }
  303.       }
  304.    _delay_ms(3000);
  305.    reset();
  306.    etap2();
  307.    _delay_ms(3000);
  308.    reset();
  309.    }
  310. }
  311. // etap 2b - czerwone na przejściu dla pieszych, żółte do góry
  312. void etap2b(void)
  313. {
  314.    for (i=47; i>=0; i--)
  315.    {
  316.       if (i==13 || i==14 || i==18) //światła zielone
  317.       {
  318.          PORTB=ZAPAL;
  319.          PORTB=CLK0;
  320.       }
  321.       else if (i==0 || i==8 || i==20 || i==22 || i==24 || i==27 || i==30 || i==38 || i==44 || i==47 || i==4 || i==7 || i==41 || i==36) //światła czerwone
  322.       {
  323.          PORTB=ZAPAL;
  324.          PORTB=CLK0;
  325.       }
  326.       else if (i==3 || i==11) //strzałki
  327.       {
  328.          PORTB=ZAPAL;
  329.          PORTB=CLK0;
  330.       }
  331.       else if (i==33) // pomarańczowe
  332.       {
  333.          PORTB=ZAPAL;
  334.          PORTB=CLK0;
  335.       }
  336.       else
  337.       {
  338.          PORTB=ZGAS;
  339.          PORTB=CLK0;
  340.       }
  341.    }
  342. }
  343. // etap 2c - czerwone na przejściu dla pieszych, jeździe w górę; start w prawo (czerwone+żółte)
  344. void etap2c(void)
  345. {
  346.    for (i=47; i>=0; i--)
  347.    {
  348.       if (i==13 || i==14 || i==18) //światła zielone
  349.       {
  350.          PORTB=ZAPAL;
  351.          PORTB=CLK0;
  352.       }
  353.       else if (i==0 || i==8 || i==20 || i==22 || i==24 || i==27 || i==30 || i==38 || i==44 || i==47 || i==4 || i==7 || i==32 || i==41 || i==36) //światła czerwone
  354.       {
  355.          PORTB=ZAPAL;
  356.          PORTB=CLK0;
  357.       }
  358.       else if (i==3 || i==11) //strzałki
  359.       {
  360.          PORTB=ZAPAL;
  361.          PORTB=CLK0;
  362.       }
  363.       else if (i==29) // pomarańczowe
  364.       {
  365.          PORTB=ZAPAL;
  366.          PORTB=CLK0;
  367.       }
  368.       else
  369.       {
  370.          PORTB=ZGAS;
  371.          PORTB=CLK0;
  372.       }
  373.    }
  374. }
  375.  
  376. //----------------------------------------------------------------------------------------------------------
  377. // etap 3 - dół i lewo
  378. void etap3(void)
  379. {
  380.    for (i=47; i>=0; i--)
  381.    {
  382.       if (i==13 || i==14 || i==18 || i==25 || i==26 || i==28 || i==37 || i==39) //światła zielone
  383.       {
  384.          PORTB=ZAPAL;
  385.          PORTB=CLK0;
  386.       }
  387.       else if (i==0 || i==4 || i==7 || i==8 || i==20 || i==22 || i==32 || i==41 || i==44 || i==47) //światła czerwone
  388.       {
  389.          PORTB=ZAPAL;
  390.          PORTB=CLK0;
  391.       }
  392.       else if (i==3 || i==11) //strzałki
  393.       {
  394.          PORTB=ZAPAL;
  395.          PORTB=CLK0;
  396.       }
  397.       else
  398.       {
  399.          PORTB=ZGAS;
  400.          PORTB=CLK0;
  401.       }
  402.    }
  403. }
  404. // etap 3a - mruganie świateł na przejściu dla pieszych
  405. void etap3a(void)
  406. {
  407.    for (j=0; j<2; j++)
  408.    {
  409.       for (i=47; i>=0; i--)
  410.       {
  411.          if (i==18 || i==25 || i==26 || i==28 || i==37 || i==39) //światła zielone
  412.          {
  413.             PORTB=ZAPAL;
  414.             PORTB=CLK0;
  415.          }
  416.          else if (i==0 || i==4 || i==7 || i==8 || i==20 || i==22 || i==32 || i==41 || i==44 || i==47) //światła czerwone
  417.          {
  418.             PORTB=ZAPAL;
  419.             PORTB=CLK0;
  420.          }
  421.          else if (i==3 || i==11) //strzałki
  422.          {
  423.             PORTB=ZAPAL;
  424.             PORTB=CLK0;
  425.          }
  426.          else
  427.          {
  428.             PORTB=ZGAS;
  429.             PORTB=CLK0;
  430.          }
  431.       }
  432.    _delay_ms(3000);
  433.    reset();
  434.    etap3();
  435.    _delay_ms(3000);
  436.    reset();
  437.    }
  438. }
  439. // etap 3b - czerwone na przejściu dla pieszych, żółte w dół
  440. void etap3b(void)
  441. {
  442.    for (i=47; i>=0; i--)
  443.    {
  444.       if (i==25 || i==26 || i==37 || i==39) //światła zielone
  445.       {
  446.          PORTB=ZAPAL;
  447.          PORTB=CLK0;
  448.       }
  449.       else if (i==0 || i==4 || i==7 || i==8 || i==20 || i==22 || i==32 || i==41 || i==44 || i==47 || i==15 || i==12) //światła czerwone
  450.       {
  451.          PORTB=ZAPAL;
  452.          PORTB=CLK0;
  453.       }
  454.       else if (i==3 || i==11) //strzałki
  455.       {
  456.          PORTB=ZAPAL;
  457.          PORTB=CLK0;
  458.       }
  459.       else if (i==17 || i==29) // pomarańczowe
  460.       {
  461.          PORTB=ZAPAL;
  462.          PORTB=CLK0;
  463.       }
  464.       else
  465.       {
  466.          PORTB=ZGAS;
  467.          PORTB=CLK0;
  468.       }
  469.    }
  470. }
  471. // etap 3c - czerwone na przejściu dla pieszych, w dół; start w poprzek (czerwone+żółte)
  472. void etap3c(void)
  473. {
  474.    for (i=47; i>=0; i--)
  475.    {
  476.       if (i==25 || i==26 || i==37 || i==39) //światła zielone
  477.       {
  478.          PORTB=ZAPAL;
  479.          PORTB=CLK0;
  480.       }
  481.       else if (i==0 || i==4 || i==7 || i==8 || i==20 || i==22 || i==32 || i==41 || i==44 || i==47 || i==16 || i==30 || i==9 || i==15 || i==12) //światła czerwone
  482.       {
  483.          PORTB=ZAPAL;
  484.          PORTB=CLK0;
  485.       }
  486.       else if (i==3 || i==11) //strzałki
  487.       {
  488.          PORTB=ZAPAL;
  489.          PORTB=CLK0;
  490.       }
  491.       else if (i==1 || i==9) // pomarańczowe
  492.       {
  493.          PORTB=ZAPAL;
  494.          PORTB=CLK0;
  495.       }
  496.       else
  497.       {
  498.          PORTB=ZGAS;
  499.          PORTB=CLK0;
  500.       }
  501.    }
  502. }
  503.  
  504. //----------------------------------------------------------------------------------------------------------
  505. // etap 4 - w poprzek
  506. void etap4(void)
  507. {
  508.    for (i=47; i>=0; i--)
  509.    {
  510.       if (i==2 || i==10 || i==21 || i==23 || i==25 || i==26 || i==37 || i==39 || i==42 || i==43) //światła zielone
  511.       {
  512.          PORTB=ZAPAL;
  513.          PORTB=CLK0;
  514.       }
  515.       else if (i==4 || i==7 || i==12 || i==15 || i==16 || i==30 || i==32 || i==47) //światła czerwone
  516.       {
  517.          PORTB=ZAPAL;
  518.          PORTB=CLK0;
  519.       }
  520.       else if (i==19 || i==35) //strzałki
  521.       {
  522.          PORTB=ZAPAL;
  523.          PORTB=CLK0;
  524.       }
  525.       else
  526.       {
  527.          PORTB=ZGAS;
  528.          PORTB=CLK0;
  529.       }
  530.    }
  531. }
  532. // etap 4a - mruganie świateł na przejściu dla pieszych
  533. void etap4a(void)
  534. {
  535.    for (j=0; j<2; j++)
  536.    {
  537.       for (i=47; i>=0; i--)
  538.       {
  539.          if (i==2 || i==10 || i==21 || i==23 || i==42 || i==43) //światła zielone
  540.          {
  541.             PORTB=ZAPAL;
  542.             PORTB=CLK0;
  543.          }
  544.          else if (i==4 || i==7 || i==12 || i==15 || i==16 || i==30 || i==32 || i==47) //światła czerwone
  545.          {
  546.             PORTB=ZAPAL;
  547.             PORTB=CLK0;
  548.          }
  549.          else if (i==19 || i==35) //strzałki
  550.          {
  551.             PORTB=ZAPAL;
  552.             PORTB=CLK0;
  553.          }
  554.          else
  555.          {
  556.             PORTB=ZGAS;
  557.             PORTB=CLK0;
  558.          }
  559.       }
  560.    _delay_ms(3000);
  561.    reset();
  562.    etap4();
  563.    _delay_ms(3000);
  564.    reset();
  565.    }
  566. }
  567. // etap 4b - czerwone na przejściu dla pieszych, żółte w poprzek
  568. void etap4b(void)
  569. {
  570.    for (i=47; i>=0; i--)
  571.    {
  572.       if (i==21 || i==23 || i==42 || i==43) //światła zielone
  573.       {
  574.          PORTB=ZAPAL;
  575.          PORTB=CLK0;
  576.       }
  577.       else if (i==4 || i==7 || i==12 || i==15 || i==16 || i==30 || i==32 || i==47 || i==24 || i==27 || i==36 || i==38) //światła czerwone
  578.       {
  579.          PORTB=ZAPAL;
  580.          PORTB=CLK0;
  581.       }
  582.       else if (i==19 || i==35) //strzałki
  583.       {
  584.          PORTB=ZAPAL;
  585.          PORTB=CLK0;
  586.       }
  587.       else if (i==1 || i==9) // pomarańczowe
  588.       {
  589.          PORTB=ZAPAL;
  590.          PORTB=CLK0;
  591.       }
  592.       else
  593.       {
  594.          PORTB=ZGAS;
  595.          PORTB=CLK0;
  596.       }
  597.    }
  598. }
  599. // etap 4c - czerwone na przejściu dla pieszych, w poprzek; start w górę i lewo (czerwone+żółte)
  600. void etap4c(void)
  601. {
  602.    for (i=47; i>=0; i--)
  603.    {
  604.       if (i==21 || i==23 || i==42 || i==43) //światła zielone
  605.       {
  606.          PORTB=ZAPAL;
  607.          PORTB=CLK0;
  608.       }
  609.       else if (i==4 || i==7 || i==12 || i==15 || i==16 || i==30 || i==32 || i==47 || i==24 || i==27 || i==36 || i==38 || i==8 || i==0) //światła czerwone
  610.       {
  611.          PORTB=ZAPAL;
  612.          PORTB=CLK0;
  613.       }
  614.       else if (i==19 || i==35) //strzałki
  615.       {
  616.          PORTB=ZAPAL;
  617.          PORTB=CLK0;
  618.       }
  619.       else if (i==33 || i==46) // pomarańczowe
  620.       {
  621.          PORTB=ZAPAL;
  622.          PORTB=CLK0;
  623.       }
  624.       else
  625.       {
  626.          PORTB=ZGAS;
  627.          PORTB=CLK0;
  628.       }
  629.    }
  630. }
  631.  
  632. //----------------------------------------------------------------------------------------------------------
  633. /*void awaria(void)
  634. {
  635.    while(1)
  636.    {
  637.       reset();
  638.       _delay_ms(CZAS_MIGANIA);
  639.       zolte();
  640.       _delay_ms(CZAS_MIGANIA);
  641.       przycisk();
  642.       if (stan==0) break;
  643.    }
  644. }
  645. */
  646. void main (void)
  647. {
  648.    DDRB=0x3F;
  649.    reset();
  650.    _delay_ms(2000);
  651.    while(1)
  652.    {
  653.       if (stan==1)
  654.          {
  655.          while(1)
  656.             {
  657.                reset();
  658.                _delay_ms(CZAS_MIGANIA);
  659.                zolte();
  660.                _delay_ms(CZAS_MIGANIA);
  661.                przycisk();
  662.                if (stan==0) break;
  663.             }
  664.          }
  665.       else if (stan==0)
  666.          {
  667.          while(1)
  668.             {
  669.             przycisk();
  670.             if (stan==1) break;
  671.             etap1();
  672.             przycisk();
  673.             if (stan==1) break;
  674.             _delay_ms(10000);
  675.             reset();
  676.             przycisk();
  677.             if (stan==1) break;
  678.             etap1a();
  679.             przycisk();
  680.             if (stan==1) break;
  681.             reset();
  682.             przycisk();
  683.             if (stan==1) break;
  684.             etap1b();
  685.             przycisk();
  686.             if (stan==1) break;
  687.             _delay_ms(CZAS_MIGANIA);
  688.             reset();
  689.             przycisk();
  690.             if (stan==1) break;
  691.             etap1c();
  692.             przycisk();
  693.             if (stan==1) break;
  694.             _delay_ms(CZAS_MIGANIA);
  695.             reset();
  696.  
  697.             przycisk();
  698.             if (stan==1) break;
  699.             etap2();
  700.             przycisk();
  701.             if (stan==1) break;
  702.             _delay_ms(10000);
  703.             reset();
  704.             przycisk();
  705.             if (stan==1) break;
  706.             etap2a();
  707.             przycisk();
  708.             if (stan==1) break;
  709.             reset();
  710.             przycisk();
  711.             if (stan==1) break;
  712.             etap2b();
  713.             przycisk();
  714.             if (stan==1) break;
  715.             _delay_ms(CZAS_MIGANIA);
  716.             reset();
  717.             przycisk();
  718.             if (stan==1) break;
  719.             etap2c();
  720.             przycisk();
  721.             if (stan==1) break;
  722.             _delay_ms(CZAS_MIGANIA);
  723.             reset();
  724.  
  725.             przycisk();
  726.             if (stan==1) break;
  727.             etap3();
  728.             przycisk();
  729.             if (stan==1) break;
  730.             _delay_ms(10000);
  731.             reset();
  732.             przycisk();
  733.             if (stan==1) break;
  734.             etap3a();
  735.             przycisk();
  736.             if (stan==1) break;
  737.             reset();
  738.             przycisk();
  739.             if (stan==1) break;
  740.             etap3b();
  741.             przycisk();
  742.             if (stan==1) break;
  743.             _delay_ms(CZAS_MIGANIA);
  744.             reset();
  745.             przycisk();
  746.             if (stan==1) break;
  747.             etap3c();
  748.             przycisk();
  749.             if (stan==1) break;
  750.             _delay_ms(CZAS_MIGANIA);
  751.             reset();
  752.  
  753.             przycisk();
  754.             if (stan==1) break;
  755.             etap4();
  756.             przycisk();
  757.             if (stan==1) break;
  758.             _delay_ms(10000);
  759.             reset();
  760.             przycisk();
  761.             if (stan==1) break;
  762.             etap4a();
  763.             przycisk();
  764.             if (stan==1) break;
  765.             reset();
  766.             przycisk();
  767.             if (stan==1) break;
  768.             etap4b();
  769.             przycisk();
  770.             if (stan==1) break;
  771.             _delay_ms(CZAS_MIGANIA);
  772.             reset();
  773.             przycisk();
  774.             if (stan==1) break;
  775.             etap4c();
  776.             przycisk();
  777.             if (stan==1) break;
  778.             _delay_ms(CZAS_MIGANIA);
  779.             reset();
  780.             }
  781.          }
  782.    }
  783. }
Add Comment
Please, Sign In to add comment