Hi
Please could some one help me clear up any misconceptions i may have.
i'm trying to understand the concept of using a push button as a switch. I can find many examples of holding down a push button and the LED turns "on" or "off", but i cant find any examples of the following scenario
push the push button down and release it, and the LED turns "on" and stays "on"
push the push button down a second time and release it, and the LED turns "off" and stays "off"
Please could some body help me grasp this concept and or even perhaps show me by example code.
i would be very gratefull
Thank you,
but i cant find any examples of the following scenario
You haven't looked vary hard, then.
Why don't you try something? You know how to read a switch state, right?
You know how to determine that the switch is pressed now, but was not pressed last time, or is now pressed now, but was last time. If not, look at the state change detect example.
If the switch is pressed, toggle the state of the LED pin -