Finite state machine (FSM) programming languages like IsoMAX
are becoming quite popular with robot builders. Because most of us grew up
working with structured, procedural code, the occasional how-to
article can be helpful. Michael Kreiman has written an embedded.com
article that describes a subset of UML statechart notation that leads to
relatively simple code implementations for embedded applications.
Kreiman's model takes into account two types of FSMs, event-based state
machines and periodic state machines. Sample source code in C is
provided for the example program described in the article.
Although I like the www.newmicros.com ISOPOD a lot, I ran into this
tidbit, that some of you might find interesting.
IAR just happens to have visualState a graphical design tool for
generating optimized C++ code using a State machine system.
When I worked at Samsung, it seemed that all we ever did was UML, state
machines, and documentation. We spent months with rational rose
drawing cute UML state machine art and writing ISO docs and wasting
months of good man hours on boring and seemingly non-productive stuff
like that. Even though it probably did help us with writing our
program a bit, I'm still hard headed enough to think that UML and state
machines are overrated and overhyped. I especially hate
documentation. I guess I still have the "dang, just let me code it"
attitude hard head. Yeah, yeah, design and document CYA, but I still
get a big thrill out of just coding at home without having to design or
document. I guess that's why state machine languages have a stigma
with me. It just seems like UML or documentation all over again that I
hate so much so I'm just a little paranoid even getting into it.