A simple button controlled finite state machine  for Arduino