have a look in the manual for button_toggle and button_state