Bravo, Alain!
If you haven't seen it, here is Alain's tested circuit:
<IMG SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2007&stc=1&d=118952080 6">
(His PDF file is easier to read.)
The input is at 2.75 VDC, eliminating the worry about a floating input pin when the input is set to high-Z.
I think I mentioned the possibility of using MOSFETs several posts back. I was going to try it with Luciano's original circuit, something like this:
<IMG SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2008&stc=1&d=118952090 8">
Exchanging the positions of R6 with D1 and R5 with D2 in Alain's version will accomplish the same result, but without the voltage divider.





Bookmarks