I have been running an ultrasonic sensor on a raspberry pi for a while, with quite some good results.
I wanted to port this on an esp8266 and, it looks like the result are a bit less accurate than on the pi.
Here is the graphs usage of each one :
The line is quite smoother on the pi.
Here is the code i use on the esp8266 to get the values :
Code: Select all
I suspect that the tick is less reliable on the esp8266 than on the pi. For example, in an other project, using a timer of 90000 milliseconds yield in a run of 82 seconds.
Any idea on how the code could be getting better result out of this sensor on esp8266?