understanding attachinterrupt in a pulse counter