Help with a pulse detection func

(i bought a premade sensor already)

But, you're not going to tell us which one. Well, then, how are we supposed to write your code to read it?

either becoming higher or lowe id like the avr to detect the change in the patterns and write high (then low again) to a digital port.

Are you going to be able to see an LED that is turned on only for a new nanoseconds? Or is there supposed to be some interval between HIGH and LOW?

You want the same pin lit up for high and low pulse? 100 IS high, by the way. Typical resting pulse is more like 72.