
Originally Posted by
Humbleworker
Utilizing a laser and a photo transistor and a PIC16F628A with an onboard 4mhz oscillator, I would like to extract (as a variable of data) the time of how long the beam is cut and how long it is uncut. How do you do it? I have no clue.
Hi,
You can measure the High state duration and after, the low state ...
The PULSIN command looks pretty cool for that.
Now, as the PULSIN command can't measure the Low state just following the High state ... it will only measure the "second" Low state !
Here you can try a PULSIN, Pin,1, resultH... for High state,immediatly followed by a RCTime Pin,0,resultL for Low State ... and then have the result for 1 only "period" ...
...
Want to measure speed of light ???
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks