I was just wondering if there was a way to code a state change when a switch is toggled on or off but have it perform the same action?
Example: Switch is thrown to on and registers HIGH so the light comes on. But then it is thrown to the off position and instead of turning the light off it detects the change but the result is the light coming on again.
I know this example makes no logical sense for practical use with a light since it just means the light stays on but its the best way I can explain it. But its actually just about registering a state change and then performing the same action for both HIGH and LOW states.