PING software or hardware read method without waiting
Besides using a CPU.pulseIn() command, is there a way to read the return pulse length without having to wait for the longest pulse (e.g. 2131, which is about 19 milliseconds)?
This way the CPU can do other processing and come later to check the result.
This way the CPU can do other processing and come later to check the result.
Comments
are 1 msec, then pulseIn returns after 1 msec + waittime for pulsestart.
pulseIn uses 8.68 usec resolution.
If that resolution is not that important, you can do (pseudo code)
mark a timer
loop {
···check the pin for the right edge (rising or falling),
·· do something else
}
get the time passed.
regards peter
·
thanks,