Base code generator for Arduino state machines