Thanks for the replies all.
I set the debounce to 100 and the problem is gone! The limits still work fine but they have to be pressed in fully.
Thankyou.
It may have had something to do with my body capacitance, but I just don't think so, I really think the switch was just too sensitive.....I know that the connections should be done properly....they are blade terminals and I have plenty of crimp connectors but unfortunately not enough time!
I've had this machine about four or five months. I designed and built it myself. Its made of wood, and is mounted in a wooden enclosure 3 feet from the ground inside a wooden shed, so I don't think earth leakage is a problem...yet!
If you would like you can see my build thread at the link below, but it hasn't been updated with pics since I moved, so the new enclosure, new gantry and Z carriage, and new workshop are not shown.
Thanks again.
http://www.cnczone.com/forums/showthread.php?t=35211