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?

…R

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.

Cheers!

int cnt;

void setup() {

Serial.begin(9600);
attachinterrupt(2,ISR_1,RSING); /* interrrupt for rising edged pulse having Frequency 10Khz */
pinMode(2,INPUT);
}

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

void ISR_1() {
cnt++;
Serial.println(cnt);
}

you cannot use Serial.print in a ISR

RSING ?

pin 2 is interrupt 0

See: