bool _gtv1;
bool _gtv2;
bool _gtv3;
bool _swi20;
bool _bounseInputD19S = 0;
bool _bounseInputD19O = 0;
unsigned long _bounseInputD19P = 0UL;
String _swi6;
bool _count5I = 0;
int _count5_Value = 0;
bool _count5MaxLO = 0;
String _swi8;
bool _trgr2 = 0;
bool _trgr3 = 0;
bool _swi19;
bool _gen1I = 0;
bool _gen1O = 0;
unsigned long _gen1P = 0UL;
bool _bounseInputD13S = 0;
bool _bounseInputD13O = 0;
unsigned long _bounseInputD13P = 0UL;
float _swi11;
bool _gen2I = 0;
bool _gen2O = 0;
unsigned long _gen2P = 0UL;
String _swi1;
bool _trgr1 = 0;
float _swi13;
String _swi16;
String _Terminal_93712272;
bool _bounseInputD18S = 0;
bool _bounseInputD18O = 0;
unsigned long _bounseInputD18P = 0UL;
bool _trgt2 = 0;
bool _trgt2I = 0;
bool _gen4I = 0;
bool _gen4O = 0;
unsigned long _gen4P = 0UL;
bool _tim1I = 0;
bool _tim1O = 0;
unsigned long _tim1P = 0UL;
int _sido2TB = 0;
String _sido2TSN;
bool _sido2a1 = 0;
bool _sido2b1 = 0;
bool _sido2c1 = 0;
bool _sido2d1 = 0;
bool _sido2e1 = 0;
bool _sido2f1 = 0;
bool _sido2g1 = 0;
bool _sido2dp = 0;
bool _sido2r1 = 0;
bool _sido2r2 = 0;
bool _sido2r3 = 0;
bool _sido2r4 = 0;
int _sido2Raz = 1;
unsigned long _sido2STi = 0UL;
bool _sido2Mod = 0;
float _swi12;
String _swi10;
String _swi22;
float _swi9;
bool _gen3I = 0;
bool _gen3O = 0;
unsigned long _gen3P = 0UL;
String _swi4;
bool _bounseInputD17S = 0;
bool _bounseInputD17O = 0;
unsigned long _bounseInputD17P = 0UL;
bool _count1I = 0;
bool _count1_SCST = 0;
int _count1_Value = 0;
String _swi2;
bool _bounseInputD16S = 0;
bool _bounseInputD16O = 0;
unsigned long _bounseInputD16P = 0UL;
float _swi14;
bool _count3I = 0;
int _count3_Value = 0;
bool _swi7;
bool _swi17;
String _swi21;
String _swi15;
bool _swi3;
bool _count4I = 0;
bool _count4_SCST = 0;
int _count4_Value = 0;
bool _count4MaxLO = 0;
float _swi5;
String _swi23;
void setup()
{
    pinMode(17, INPUT_PULLUP);
    pinMode(16, INPUT_PULLUP);
    pinMode(13, INPUT_PULLUP);
    pinMode(18, INPUT_PULLUP);
    pinMode(19, INPUT_PULLUP);
    pinMode(9, OUTPUT);
    digitalWrite(9, 0);
    pinMode(8, OUTPUT);
    digitalWrite(8, 0);
    pinMode(7, OUTPUT);
    digitalWrite(7, 0);
    pinMode(6, OUTPUT);
    digitalWrite(6, 0);
    pinMode(5, OUTPUT);
    digitalWrite(5, 0);
    pinMode(4, OUTPUT);
    digitalWrite(4, 0);
    pinMode(3, OUTPUT);
    digitalWrite(3, 0);
    pinMode(2, OUTPUT);
    digitalWrite(2, 0);
    pinMode(0, OUTPUT);
    digitalWrite(0, 0);
    pinMode(12, OUTPUT);
    digitalWrite(12, 0);
    pinMode(11, OUTPUT);
    digitalWrite(11, 0);
    pinMode(10, OUTPUT);
    digitalWrite(10, 0);
    pinMode(1, OUTPUT);
    digitalWrite(1, 0);
    _bounseInputD16O =  digitalRead(16);
    _bounseInputD17O =  digitalRead(17);
    _bounseInputD19O =  digitalRead(19);
    _bounseInputD13O =  digitalRead(13);
    _bounseInputD18O =  digitalRead(18);
}
void loop()
{
    bool  _bounceInputTmpD13 =  (digitalRead (13));
    if (_bounseInputD13S)
    {
        if (millis() >= (_bounseInputD13P + 40))
        {
            _bounseInputD13O= _bounceInputTmpD13;
            _bounseInputD13S=0;
        }
    }
    else
    {
        if (_bounceInputTmpD13 != _bounseInputD13O)
        {
            _bounseInputD13S=1;
            _bounseInputD13P = millis();
        }
    }
    bool  _bounceInputTmpD17 =  (digitalRead (17));
    if (_bounseInputD17S)
    {
        if (millis() >= (_bounseInputD17P + 40))
        {
            _bounseInputD17O= _bounceInputTmpD17;
            _bounseInputD17S=0;
        }
    }
    else
    {
        if (_bounceInputTmpD17 != _bounseInputD17O)
        {
            _bounseInputD17S=1;
            _bounseInputD17P = millis();
        }
    }
    bool  _bounceInputTmpD19 =  (digitalRead (19));
    if (_bounseInputD19S)
    {
        if (millis() >= (_bounseInputD19P + 40))
        {
            _bounseInputD19O= _bounceInputTmpD19;
            _bounseInputD19S=0;
        }
    }
    else
    {
        if (_bounceInputTmpD19 != _bounseInputD19O)
        {
            _bounseInputD19S=1;
            _bounseInputD19P = millis();
        }
    }
    bool  _bounceInputTmpD18 =  (digitalRead (18));
    if (_bounseInputD18S)
    {
        if (millis() >= (_bounseInputD18P + 40))
        {
            _bounseInputD18O= _bounceInputTmpD18;
            _bounseInputD18S=0;
        }
    }
    else
    {
        if (_bounceInputTmpD18 != _bounseInputD18O)
        {
            _bounseInputD18S=1;
            _bounseInputD18P = millis();
        }
    }
    bool  _bounceInputTmpD16 =  (digitalRead (16));
    if (_bounseInputD16S)
    {
        if (millis() >= (_bounseInputD16P + 40))
        {
            _bounseInputD16O= _bounceInputTmpD16;
            _bounseInputD16S=0;
        }
    }
    else
    {
        if (_bounceInputTmpD16 != _bounseInputD16O)
        {
            _bounseInputD16S=1;
            _bounseInputD16P = millis();
        }
    }
    //Плата:1
    if(!(_bounseInputD18O)) _trgr2 = 0;
    if((((((analogRead (0)))/(68.2)) >= (_swi9)) || (_trgr1))) _trgr2 = 1;
    if(_trgr2) _trgr3 = 0;
    if(!(_bounseInputD18O)) _trgr3 = 1;
    if(!(_bounseInputD13O))
    {
        _swi22=(_floatToStringWitRaz(((analogRead (0)))/(68.2),1));
    }
    else
    {
        _swi22=(((_floatToStringWitRaz(((analogRead (1)))/(102.3),1))) + (String("A")));
    }
    if(_tim1O)
    {
        _swi8=_swi16;
    }
    else
    {
        _swi8=_swi22;
    }
    if(!(_trgr3))
    {
        _swi4=String("OFF");
    }
    else
    {
        _swi4=_swi8;
    }
    if(_trgt2)
    {
        _swi23=_Terminal_93712272;
    }
    else
    {
        _swi23=_swi4;
    }
    digitalWrite(1, ((!(_bounseInputD13O)) || (_trgr2)));
    if(!(_bounseInputD13O))
    {
        _swi7=1;
    }
    else
    {
        _swi7=0;
    }
    if(!(_bounseInputD13O))
    {
        _swi20=0;
    }
    else
    {
        _swi20=1;
    }
    if (!(0)) 
    {
         if (! _gen2I) 
        {
            _gen2I = 1;
            _gen2O = 1;
            _gen2P = millis();
        }
    }
     else 
    {
        _gen2I = 0 ;
        _gen2O= 0;
    }
    if (_gen2I) 
    {
          if (_isTimer (_gen2P , 500)) 
        {
             _gen2P = millis();
            _gen2O = ! _gen2O;
        }
    }
    if(_trgt2)
    {
        _swi3=_gen2O;
    }
    else
    {
        _swi3=_swi20;
    }
    if(_isTimer(_sido2STi, 1)) 
    {
        _sido2STi = millis();
        if (_sido2Raz > 4) 
        {
            _sido2Raz = 1;
        }
        if(_sido2Mod)
        {
            _sido2a1 =1;
            _sido2b1 =1;
            _sido2c1 =1;
            _sido2d1 =1;
            _sido2e1 =1;
            _sido2f1 =1;
            _sido2g1 =1;
            _sido2r4 =0;
            _sido2r3 =0;
            _sido2r2 =0;
            _sido2r1 =0;
            _sido2Mod=0;
        }
         else 
        {
            _sido2TSN = _swi23;
            _sido2TB = _IntToSevenSegment(_charFromStringForIndex(_sido2TSN,_sido2Raz));
            _sido2a1 =! bitRead(_sido2TB, 0);
            _sido2b1 =! bitRead(_sido2TB, 1);
            _sido2c1 =! bitRead(_sido2TB, 2);
            _sido2d1 =! bitRead(_sido2TB, 3);
            _sido2e1 =! bitRead(_sido2TB, 4);
            _sido2f1 =! bitRead(_sido2TB, 5);
            _sido2g1 =! bitRead(_sido2TB, 6);
            _sido2r4 =  (_sido2Raz==1);
            _sido2r3 =  (_sido2Raz==2);
            _sido2r2 =  (_sido2Raz==3);
            _sido2r1 =  (_sido2Raz==4);
            if(_sido2Raz == 4) 
            {
                _sido2dp = !  (_swi3);
            }
            if(_sido2Raz == 3) 
            {
                _sido2dp = !  (_swi7);
            }
            if(_sido2Raz == 2) 
            {
                _sido2dp = !  (0);
            }
            if(_sido2Raz == 1) 
            {
                _sido2dp = !  (0);
            }
            _sido2Raz = _sido2Raz +1;
            _sido2Mod=1;
        }
    }
    digitalWrite(0, _sido2r4);
    digitalWrite(2, _sido2r3);
    digitalWrite(3, _sido2r2);
    digitalWrite(4, _sido2r1);
    digitalWrite(5, _sido2dp);
    digitalWrite(6, _sido2g1);
    digitalWrite(7, _sido2f1);
    digitalWrite(8, _sido2e1);
    digitalWrite(9, _sido2d1);
    digitalWrite(10, _sido2c1);
    digitalWrite(11, _sido2b1);
    digitalWrite(12, _sido2a1);
    //Плата:2
    bool  _tmp2 = !(_bounseInputD19O);
    if (_tmp2)  
    {
         if (! _trgt2I) _trgt2 = ! _trgt2;
    }
    _trgt2I = _tmp2;
    if(_trgt2)
    {
        _swi19=0;
    }
    else
    {
        _swi19=!(_bounseInputD17O);
    }
    if(_trgt2)
    {
        _swi17=0;
    }
    else
    {
        _swi17=!(_bounseInputD16O);
    }
    if(((_swi17) || (_swi19))) 
    {
        _tim1O = 1;
        _tim1I = 1;
    }
     else 
    {
         if(_tim1I) 
        {
            _tim1I = 0;
            _tim1P = millis();
        }
         else 
        {
             if (_tim1O) 
            {
                if (_isTimer(_tim1P, 3000)) _tim1O = 0;
            }
        }
    }
    if (_gtv1)
    {
        _count4_Value = 0;
    }
     else 
    {
        if (_swi17)
        {
            if (! _count4I) 
            {
                _count4I = 1;
                _count4_Value = _count4_Value + 1;
            }
        }
         else 
        {
            _count4I = 0;
        }
        if (_swi19)
        {
            if (! _count4_SCST) 
            {
                _count4_SCST = 1;
                if(_count4_Value > 0) 
                {
                    _count4_Value = _count4_Value - 1;
                }
            }
        }
         else 
        {
            _count4_SCST = 0;
        }
    }
    _count4MaxLO = _count4_Value >= 7;
    if((_count4_Value) == (0))
    {
        _swi12=13.00;
    }
    else
    {
        _swi12=0;
    }
    if((_count4_Value) == (0))
    {
        _swi2=String("40");
    }
    else
    {
        _swi2=String("");
    }
    if((_count4_Value) == (1))
    {
        _swi1=String("50");
    }
    else
    {
        _swi1=_swi2;
    }
    if((_count4_Value) == (1))
    {
        _swi5=13.2;
    }
    else
    {
        _swi5=_swi12;
    }
    if((_count4_Value) == (2))
    {
        _swi13=13.3;
    }
    else
    {
        _swi13=_swi5;
    }
    if((_count4_Value) == (2))
    {
        _swi6=String("60");
    }
    else
    {
        _swi6=_swi1;
    }
    if((_count4_Value) == (3))
    {
        _swi10=String("70");
    }
    else
    {
        _swi10=_swi6;
    }
    if((_count4_Value) == (3))
    {
        _swi14=13.4;
    }
    else
    {
        _swi14=_swi13;
    }
    if((_count4_Value) == (4))
    {
        _swi11=13.5;
    }
    else
    {
        _swi11=_swi14;
    }
    if((_count4_Value) == (4))
    {
        _swi15=String("80");
    }
    else
    {
        _swi15=_swi10;
    }
    if((_count4_Value) == (5))
    {
        _swi16=String("90");
    }
    else
    {
        _swi16=_swi15;
    }
    if((_count4_Value) == (5))
    {
        _swi9=13.6;
    }
    else
    {
        _swi9=_swi11;
    }
    _gtv1 = _count4MaxLO;
    //Плата:3
//Наименование:Таймер обратного отсчета
    if (((analogRead (6))) < (800))
    {
        if (! _count1I) 
        {
            _count1I = 1;
            if(_count1_Value < 9) 
            {
                _count1_Value = _count1_Value + 1;
            }
        }
    }
     else 
    {
        _count1I = 0;
    }
    if (((analogRead (7))) < (800))
    {
        if (! _count1_SCST) 
        {
            _count1_SCST = 1;
            if(_count1_Value > 0) 
            {
                _count1_Value = _count1_Value - 1;
            }
        }
    }
     else 
    {
        _count1_SCST = 0;
    }
    if (!(_gtv3)) 
    {
         if (! _gen1I) 
        {
            _gen1I = 1;
            _gen1O = 1;
            _gen1P = millis();
        }
    }
     else 
    {
        _gen1I = 0 ;
        _gen1O= 0;
    }
    if (_gen1I) 
    {
          if (_isTimer (_gen1P , 500)) 
        {
             _gen1P = millis();
            _gen1O = ! _gen1O;
        }
    }
    if(_gen1O)
    {
        _swi21=String(" : ");
    }
    else
    {
        _swi21=String("   ");
    }
    if (_gtv3) 
    {
        if (! _gen4I)
        {
            _gen4I = 1;
            _gen4O = 1;
            _gen4P = millis();
        }
    }
     else 
    {
        _gen4I = 0 ;
        _gen4O= 0;
    }
     if (_gen4I &&  _gen4O)   _gen4O = !(_isTimer(_gen4P , 500));
    if (!(_gtv3)) 
    {
         if (! _gen3I) 
        {
            _gen3I = 1;
            _gen3O = 1;
            _gen3P = millis();
        }
    }
     else 
    {
        _gen3I = 0 ;
        _gen3O= 0;
    }
    if (_gen3I) 
    {
          if (_isTimer (_gen3P , 30000)) 
        {
             _gen3P = millis();
            _gen3O = ! _gen3O;
        }
    }
    if (((_gtv3) || (_gtv2)))
    {
        _count5_Value = 0;
    }
     else 
    {
        if (_gen3O)
        {
            if (! _count5I) 
            {
                _count5I = 1;
                _count5_Value = _count5_Value + 1;
            }
        }
         else 
        {
            _count5I = 0;
        }
    }
    _count5MaxLO = _count5_Value >= 60;
    if (_gen4O)
    {
        _count3_Value = 0;
    }
     else 
    {
        if (_count5MaxLO)
        {
            if (! _count3I) 
            {
                _count3I = 1;
                _count3_Value = _count3_Value + 1;
            }
        }
         else 
        {
            _count3I = 0;
        }
    }
    _Terminal_93712272 = (((String((_count1_Value)-(_count3_Value), DEC))) + (String(" ")) + ((String((60)-(_count5_Value), DEC))));
    if(0) _trgr1 = 0;
    if(((((_count1_Value)-(_count3_Value)) == (0)) && (((60)-(_count5_Value)) == (1)))) _trgr1 = 1;
    _gtv3 = _trgr1;
    _gtv2 = _count5MaxLO;
}
String  _floatToStringWitRaz(float value, int raz)
{
    return String(value,raz);
}
bool _isTimer(unsigned long startTime, unsigned long period)
{
    unsigned long currentTime;
    currentTime = millis();
    if (currentTime>= startTime) 
    {
        return (currentTime>=(startTime + period));
    }
     else 
    {
        return (currentTime >=(4294967295-startTime+period));
    }
}
byte  _IntToSevenSegment(int value)
{
    if (value==48) 
    {
        return 63;
    }
    if (value==49) 
    {
        return 6;
    }
    if (value==50) 
    {
        return 91;
    }
    if (value==51) 
    {
        return 79;
    }
    if (value==52) 
    {
        return 102;
    }
    if (value==53) 
    {
        return 109;
    }
    if (value==54) 
    {
        return 125;
    }
    if (value==55) 
    {
        return 7;
    }
    if (value==56) 
    {
        return 127;
    }
    if (value==57) 
    {
        return 111;
    }
    if (value==45) 
    {
        return 64;
    }
    if (value==65) 
    {
        return 119;
    }
    if (value==67) 
    {
        return 57;
    }
    if (value==99) 
    {
        return 88;
    }
    if (value==100) 
    {
        return 94;
    }
    if (value==69) 
    {
        return 121;
    }
    if (value==70) 
    {
        return 113;
    }
    if (value==72) 
    {
        return 118;
    }
    if (value==104) 
    {
        return 116;
    }
    if (value==76) 
    {
        return 56;
    }
    if (value==79) 
    {
        return 63;
    }
    if (value==111) 
    {
        return 92;
    }
    if (value==80) 
    {
        return 115;
    }
    if (value==114) 
    {
        return 80;
    }
    if (value==83) 
    {
        return 109;
    }
    if (value==116) 
    {
        return 120;
    }
    if (value==85) 
    {
        return 62;
    }
    if (value==117) 
    {
        return 28;
    }
    if (value==110) 
    {
        return 84;
    }
    return 0;
}
int _charFromStringForIndex(String val, int idx)
{
    int lengt=val.length();
    if(lengt < idx) return 0;
    return val.charAt(lengt-idx);
}
