PULSE counter

I'm trying to made a project of Pulse counting with interrupt and print data on Serial but i'm getting some problem can anybody please give me some code.

Post your code if you need assistance.
And please use the code button </> so your code looks like this and is easy to copy to a text editor

What creates the pulses?
How frequent are they?
What is the duration of each pulse?


Here is some code that uses Pin Change Interrupts and counts the number of transitions from low to high.

The loop() will periodically (every second) print the counter to the trace iostream and reset the counter.


int cnt;

void setup() {

attachinterrupt(2,ISR_1,RSING); /* interrrupt for rising edged pulse having Frequency 10Khz */

void loop() {
Serial.println("waiting for interrupt");

void ISR_1() {

you cannot use Serial.print in a ISR


pin 2 is interrupt 0