Closed tcoopman closed 5 years ago
Closing since I suspect that this may have been resolved a while back, but we were never sure enough that the timing was good enough to close this. I'm getting about 20 uS accuracy on a Raspberry Pi Zero. This isn't great, but probably the best we can do until the gpio char interface code gets integrated.
I'm going to do my best to include the necessary information here after a discussion with @fhunleth on slack.
So I have a setup with an ultrasonic range sensor (a HC-SR04). Before I've used
elixir_ale
to measure the time with this kind of code:This works, but was not very accurate. Now I've also tried the
elixir_ale 2.0-fah
branch a couple of weeks ago and the accuracy was much improved. So now I tried to use thegpio
code and I've noticed very strange things:nothing close to the sensor:
hand close to the sensor
Some observations:
GPIO.set_edge_mode(pin, :both, false)
and measure with the timestamps I get back I get similar strangely iterating numbers.Resources:
Hope this helps to fix this.