Robin2: You have code to change state from 1 to 0 but I don't see any code to change it back to 1. ...R
Robin2: You have code to change state from 1 to 0 but I don't see any code to change it back to 1.
...R
state = 1 - state;