joan wrote:It's not clear what you are timing. If the time start and time end are detected by the GPIO have a look at my
pigpio library. It will allow you to get timings within 5 microseconds of the actual time interval.
Hello Joan, thank you for the answer.
I am reading a digital pin, where the output signal of the light barrier is connected. The Input is HIGH when the light barrier has been crossed. I am asking for that signal with if ( input = HIGH) { " start_time = store the actual time, for instance your gpioTick() function " }
for the endtime i do the same and then i calculate the end time.
This whole proccess i working in a while loop that is active when the pi that runs as a server , has a new client connection.
When the end time is calculated , it gets sended to the client (android app)
I have not looked at the source code of gpioTick() so far , so i do not know on what time function it really depends ?
But i will look. I need a time base that is at least accurate on 1/100 second ? Do i achieve that witch the function gpioTick() ?
What if i have the following situation :
If i would youse gpioTick with your event callback function (So when Falling Edge for instance is detected) whould i it cause a big timing problem that makes the timing bad.
What is the advantage of gpioTick() on the contrary to millis() from wiringpi that is based on gettimeoftheday() ?
And i heard of a processor's free-running 1MHz timer on the older raspberry pis, so there must also be one on the Broadcom Chip BCM2837 of Pi3 .
Would the use of it achieve the accuratest timings ? Is this timer not effected of the linux proccesses ?
Sorry for that amount of questions, i am a little confused but i want to understand it and use the appropriatest functions in a correct way . I know i should just test alle the things but maybe you can help me with your experience .