While you're at it...
Add a previousState variable to determine if the button has 'changed' state since the last event.
Good practice - Not just 1 or 0
While you're at it...
Add a previousState variable to determine if the button has 'changed' state since the last event.
Good practice - Not just 1 or 0