State change detection with analog input?

Well, I'll try to buid my first low-cut filter. :fearful:
Because it is my first time I would be very grateful if someone could help me to calculate C and R.

These are my values:

digital in ( 0-5 V) (Low/High)
pulses (between 0 and 30 per second...)

I suppose I have to connectthis RC filter to the input pin (pin2 ) isnt'it?

About the suggestion of the digital low pass filter I can see how it really works...becasue I want to count pulses not voltage...so I don't know how to implemnt this in my code.

tahnks again for your support...