Flowing lamp programmed with state machine