Counts pulses on specified GPIO pin and writes to a logfile