Mr. Scott Dattalo's debounce code is a work of art. After some experience with keys, switches, photo cells and magnetic detectors, I denounce everything in software. everything.... Even debounced a few software switches. As the software denounce depends on timing, have a constant time free running interrupt routine that denounces all the input pins, and also outputs all the updated output pins at same time. Now to get on the SOAP BOX.... While Mr. Dattalo's debounce code is a work of art, But "DON'T TRY THIS AT WORK". Use the code, but don't try to emulate the style. You wrote.... >Take some time to fully understand it< It would be very difficult to modify and if it didn't work, would be hard to debug. It would be a nightmare to debug a page of code written in this style, even if you wrote it a month ago. Notice that it takes a web page to comment this code? I sort of have a rule that if it takes more lines to comment a bit of code then the code takes, then the code is too complicated. When the code is written and debuggeg, the programming job is only half over. Latter comes the modifications. Also the same code may be ported to other programs. And the time involved to write the code could be excessive. I am so impressed with this code that I tried to port it to basic one time. Bill the code http://www.dattalo.com/technical/software/pic/debo unce.html ----- Original Message ----- From: "Biswanath Dutta" To: Sent: Wednesday, February 26, 2003 6:19 PM Subject: Re: [PIC]: Debounce Circuit > Thanks to all for help. Specially Mr. Scott Dattalo whose amazing code I,ve > started using. > Take some time to fully understand it. Thanks a lot > > Biswanath Dutta > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics