Using a PIC 16F627 to implement a klappladen steuerung (folding shutter).

The problem is I have a Camera that has a programmable output. if anything moves in a Field of the Cam the switch of the Cam gives an alarm. It is a