110V switch.

I'm revising the code to this. Any thoughts?
I'm not near my arduino now.

  1. You should make both debounce and time unsigned long.
  2. I would enable the pullup on pinButton using digitalWrite(pinButton,HIGH);
  3. I would have all I/Ps buffered with an Opto Isolator.
  4. The I/P to pinButton has to be normally low going high on a push.
  5. I think you will toggle the light if you hold pinButton down (HIGH).