Problem with number of pulses with coin selector

I am using interrupt because all the source codes I am able find online that uses the same device uses interrupt.

To be honest I am not sure how to use a different function to count pulses. When ever I google " pulse counter Arduino" the interrupt function pops up.

I understand there are similar posts that uses the same device, but the posts I was able to find are solving different issues, and instead of hijacking other posts I decided to start my own.