> useful for. When the switch is activated by this moving piece > of machinery it can alert the PIC a couple of ways. Oh, another way I meant to mention was using an RC to store the event. That way you could use a general purpose I/O pin Set the pin as an input, C to ground and R to 5V via the switch. When the switch closes the C will charge up and record the closure. You can read this when your code has time. Set the pin to an output and "0" to discharge the cap. It shouldn't need a very big cap to do this, maybe a few nF. It depends on how long the switch is closed for. Discharging C through a resistor, a couple of hundred ohms, would be safe R to 5V through switch I pin --- R ---- C to 0V -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body