You have to detect when the button state (well, its pin actually) changes from LOW to HIGH (or viceversa). For this you have to use a prevBtnState variable anche check it against the current reading.
You have to detect when the button state (well, its pin actually) changes from LOW to HIGH (or viceversa). For this you have to use a prevBtnState variable anche check it against the current reading.