Use Automata Designer to graphically design event-driven state machines, and then copy the corresponding code to your app. The generated code requires no attribution.