counter function in Arduino

Any variable can be used as a counter. Increment the value when the pulse occurs.