|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
How to read a pulse?
I would like to know how to read a pulse width with the digital sidecar DIO. Any one know how to do this?
|
|
#2
|
||||
|
||||
|
Re: How to read a pulse?
Quote:
|
|
#3
|
||||
|
||||
|
Re: How to read a pulse?
ok here is the code and the spec. I threw something together using timers, but I was wondering if there is a better way. This is basically using PWM.
|
|
#4
|
||||
|
||||
|
Re: How to read a pulse?
Quote:
|
|
#5
|
||||
|
||||
|
Guess its corrupt. Here it is again.
|
|
#6
|
||||
|
||||
|
Re: How to read a pulse?
What are you trying to use this for ?
Please give some details about what you want to accomplish. |
|
#7
|
||||
|
||||
|
Re: How to read a pulse?
One application is to see if something is there. That works good with this code. But I would like to use it to see frisbees going by and knowing if they are backwards or not. There is a problem with using that code for distance. For example if I put "Wait(0.05);", then it changes my values.
|
|
#8
|
||||
|
||||
|
Re: How to read a pulse?
Quote:
|
|
#9
|
|||||
|
|||||
|
Re: How to read a pulse?
If I'm reading that datasheet correctly (it's hard to be certain of that), then your sensor there is just a simple proximity sensor. It will only switch on when an object is in detection range, and off when it's not. There's no pulsing or anything to indicate the actual distance of the object. Atleast, I don't see any indication of that, for all that it talks about triangulation. Do you have some way of measuring the output to confirm that it's giving you a PWM signal and not just off-on?
|
|
#10
|
||||
|
||||
|
Re: How to read a pulse?
I'm using it as proximity now. I love the size! I have a few of these. If I print the "Get" function then i get a number that goes up and down according to distance from the sensor. However, the values change according to how long the loop takes. So if I add a "wait" to the teleop loop, the values from the sensor change because I'm taking too long to read the pulses to accurately measure the off time.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|