#if 0
#include <Arduino.h>

enum State {S0,S1,S2,S3,S4,SE};
enum Output {O0,O1,O2,O3,O4,OE};
bool I0,I1,I2,I3,I4,ITF,IE,IOK = 0; //Podmienky prechodu

void setup()
{
    //Inicializacia
    State Q = S0;
    State next_Q;
    Output Y;
}

void loop()
{
    //Kontrola podmienok prechodu ------------
    if(0/*podmienky pre I0*/){
        I0 = 1;
    }else I0 = 0;
    //.
    //.
    //.
    if(0/*podmienky pre IOK*/){
        IOK = 1;
    }else IOK = 0;

    //Vstup----------------------------
    next_Q = Q;
    switch (Q)
    {
    case S0:
        if(I0) next_Q = S1;
        if(IE) next_Q = SE;
        break;
    case S1:
        if(I1) next_Q = S2;
        if(IE) next_Q = SE;
        break;
    case S2:
        if(!I1) next_Q = S1;
        if(I1 && I2) next_Q = S3;
        if(IE || ITF) next_Q = SE;
        break;
    case S3:
        if(I4) next_Q = S1;
        if(I1 && I3) next_Q = S4;
        if(IE || ITF) next_Q = SE;
        break;
    case S4:
        if(I4) next_Q = S1;
        if(IE || ITF) next_Q = SE;
        break;
    case SE:
        if(IOK) next_Q = S0;
        break;
    default:
        next_Q = Q;
        break;
    }

    //Pamat(Register)-----------
    Q = next_Q;

    //Vystup--------------------
    switch (Q)
    {
    case S0:
        Y = O0;
        //Inicializacia
        break;
    case S1:
        Y = O1;
        break;
    case S2:
        Y = O2;
        //Ready rezim
        break;
    case S3:
        Y = O3;
        //Startup rezim
        break;
    case S4:
        Y = O4;
        //Rezim prevadzky
        break;
    case SE:
        Y = OE;
        break;
    default:
        break;
    }
}
#endif