How to use BS2P measure time like this
Duke
Posts: 21
Hello,
I have a problem about measuring time from a Photo Interruper Device.
The pulse looks like this attached picture.
When pulse start running, I what to ignore first 2.5 ms (masking time)
Then measure the down edge of first pulse (High state)·that comes out after masking time.
Please help give me a idea how to write program detect this kind of pulse
Thank you
Duke..
I have a problem about measuring time from a Photo Interruper Device.
The pulse looks like this attached picture.
When pulse start running, I what to ignore first 2.5 ms (masking time)
Then measure the down edge of first pulse (High state)·that comes out after masking time.
Please help give me a idea how to write program detect this kind of pulse
Thank you
Duke..
Comments
·· There really isn't enough information here to write sample code...What is the state of the signal prior to the pulses coming in?· Is it always one high-pulse prior to the pulse you want to measure?· If so you can simply do a PULSIN twice and ignore the first one.· I'm not sure what you're saying about "down-edge" but if you're measuring the HIGH time, the use the same PULSIN command.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
The first pulse is always High but it doesn't have raising edge.
When start measure the signal was already High, In this case how can I use pulsin ?
I wonder if there are some commands like stop watch this I can keep lap time.
Do you have more suggestion for me
·· If the signal starts HIGH, then just sit in a tight loop checking for the pin to go LOW.· When it does, do your PULSIN.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Loop:
PULSE1
If PIN1 = O then Jump
goto loop
Jump:
...
·· More like:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com