|
Hey folks,
It's my first time here. Cheers o/
Well, I have one Orange Pi Plus 2 and I am trying to make it read from one HC-SR04 utrassonic sensor. And it sends the measured distance by turning its echo port high by one instant of time. This time is proportional to the measured distance.
To work this out, I have a interruption callback using WereCatf's WiringOP fork, that works good but I can't get correct timing because the function I am using don't give me a good and accurate values.
I've used clock_gettime() with CLOCK_REALTIME but it have some milliseconds increments every second (even if I run OPi for performance) and I don't want more than 58 microsecond increments, because this is the time for each centimeter to be measured by the sensor (more info here https://docs.google.com/document ... 2qR4vP8saG73rE/edit).
So do you guys know any way to get one time with microseconds accurace? I saw in the Allwinner H3 documentation something about it's hardware Timers but that is completely unclear to me on how to setup and make it work properly.
Thank you and sorry about my english.
|
|