Go Down

Topic: async state machine for microcontrollers (Read 607 times) previous topic - next topic

ddmcf

I also found a link in playground

http://arduino.cc/playground/Code/QP

Any pros or cons on using this?

GoForSmoke

Roll your own to fit your needs, your algorithm.

Given setup() and loop() to address real time tasks, some form of state machine approach usually makes the most sense.

My code reads and evaluates serial data as it comes in, not starting after collection. I generally need less buffer space and string manipulation code. State machine method is very useful when reading and compiling data on-the-fly.

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Go Up