Instead of using an analog input on your PIC, I'd be inclined to use a simple comparator to push the output to discreet logic levels. Just tie one comparator input to the sensor output, and the other to the wiper of a pot. That allows for simple adjustment of your sensor sensitivity (in case there is drift over time) without needing to reprogram your chip. At that point, it should be trivial to count the number of state switches. You can do it in a PIC, but it might be simpler to just use some basic hardware counter. Just be careful about bounces. Matt On Aug 3, 2007, at 7:01 AM, Paul & Lynn Tyrer wrote: > Hi. > > I have been playing around with a circuit that gives me 1.5v High > reading > using a Hall effect switch. > What I would like to do is monitor and keep a record of how many > times this > switch opens/closes and be able to pull the information from a 16f84 > (its > what I have kicking around) IS this possible and if so how easy. Is > there > any code available that already does this.? > > Any help would be greatly appreciated. > > Thanks in advance > > Paul > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist