remove state machine from arduino

replace state machine with simple timer that runs in background