Martin R. Green wrote: > I am planning to debounce a simple > pushbutton connected to a PIC input with > > weak pullups enabled. My strategy is to > read the button every 10ms, and > when 4 successive reads are the same, > consider the level valid. This will > of course mean that the button level > must be the same for at least 30ms to > be considered valid. The algorithm I am > using will easily allow checking > for up to 8 matching reads, any more > than that and I'll have to change the > method. > > Any comments on this? Is 10ms about > right? How about using 4 successive > reads, is this enough, too many, etc.? > > TIA - Martin R. Green > elimar@bigfoot.com I've always used approx. 50ms delay between testing buttons. You then don't have to test the button repeatedly, but you might loose a little "feeling". Tweaking this value improves this but then you might need quick fingers! -- Eric van Es | Cape Town, South-Africa Mailto:vanes@ilink.nis.za | WWW: http://www.nis.za/~vanes/ TEMPORARY/HOLIDAY ACCOMMODATION? http://www.nis.za/~vanes/accom.htm