Refactoring to State Machine
Added unit to generate Arduino code
First generated code