Arduino library for finite state machines