Setup variables and countPulse method, attached interrupt to method