hi, i am curious as to how the stateChanged() function in the button library works?
i need to use a momentary switch to send one thing with the first press then another thing with the second press, then back to the first and so on...just to cycle though 2 different messages.
i have been able to achieve it with a bunch of code but the button library makes things so much easier/neater. plus i am already using it for the uniquePress() function.
i am just not sure how to set up the stateChanged as there aren't any examples that i could find.
In that case, stateChanged is a function that takes no arguments, and returns true if the state of the button has changed since it was last checked, or false if it hasn't.
hmm wont that just send out "message 1" when the button is pressed and then send "message 2" when the button is released?
i am after "message 1" to be sent when the button is pressed, then nothing when the button is released. then on the second press of the button "message 2" would be sent.