Generating the state machine

To convert a state diagram into a working state machine,  select the draw windows menu and from it the code menu and then the generate option.