You should create, what it is, hysteresis(?). How should I say the thing that I can't say? Damn!
Anyways, when the first pulse says it rising, rise a flag to say it is time to wait until it reaches certain point, then don't let it hit the code again until it is going down, and after certain point, release the flag for the next pulse. You need to define those points yourself, by the curve of the components output.
Something like that, sorry, I don't know how to explain.
Yeah, it's fine. You did great explaining that. Actually, after I posted about this issue, I have coded another sketch that waits for a "rise", then wait for a preset interval before another "rise" can be sensed; a feature like a debounce. I think it is the same as what you explained here. I haven't tried the sketch yet, since we tried other components. Anyway, I'll post later the results. Thanks again!
may I propose to use dynamixel servos?
They can be programmed to continues rotation AND they feedback the current angle (and other data too, like torque and temperature).
Watch for i.e. the AX-12 (I am using them, so if you have more questions, just ask).
Thanks, great suggestion. But unfortunately, we can't afford to buy another servo, not to mention the high $$$ of the servo you suggested. But its features are awesome. ^^