add button reading and debouncing, state switching, revise measureing