@Dean said:
ving the zero bit, it should just be waiting for a change. I suppose the reason for it to be waiting for both is to reduce the chance of it missing a change in value, which I could see happening, but it may not be a big deal, so I'll change the code and try it.
The original code is written for a Momentary switch. Press it and it closes the circuit driving a change of state, release it and again it changes back to an open circuit and the pin state changes again.
You have a toggle switch which when 'flipped' remains in its new state.