1

According to https://raspberrypi.stackexchange.com/a/58825/42583, which is now nearly six years old,

one unique feature of pigpio is it times GPIO events at source so for any timing purpose pigpio is likely to be the most accurate.

In fact PIGPIO is what I've been using, and it indeed gave much better control of servos than whatever else I tried first.

Is it still the most accurate?

2 Answers 2

1

I'm not aware of any significant changes in the intervening years.

The sysfs interface has been deprecated in favour of the gpiochip interface. Any performance improvements seem to be marginal. gpiochip does provide GPIO event timestamps. Any improvement should be visible when used for decoding DHT11/22 signals. I measured little actual improvement in DHT11/22 decoding and pigpio still outperforms both sysfs andgpiochip in that regard.

0

Accuracy is a meaningless concept here. All half dozen or so libraries in common use are accurate in that they do what they say on the box.

How they differ is in speed, overhead and convenience. E.g. pigpio uses a socket/pipe interface which imposes a significant overhead but allows the user access to functionality normally restricted to kernel code.

See Controlling Raspberry Pi GPIO with c and Python for a review I did 2 years ago.

In practice I use many depending on the task in hand. E.g. pigpio is good for servos because it uses hardware timers and is unaffected by other tasks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.