I need to monitor hall sensors for position encoding with up to 350 changes per second.
Alright guys, I need to monitor hall sensors for position encoding with up to 350 changes per second. My current Python program watches GPIO pins but uses too much CPU. Here's my polling loop:
How can I make this more efficient? Should I use a different language or tool? If so, which one?
@Middleware & OS
Solution:Jump to solution
@Sterling Your program keeps checking the sensors, wasting power. Try letting the sensors interrupt the program only when they change, or use a separate task to handle them. C/C++ might be faster than Python for this job.
2 Replies
Solution
@Sterling Your program keeps checking the sensors, wasting power. Try letting the sensors interrupt the program only when they change, or use a separate task to handle them. C/C++ might be faster than Python for this job.
So I guess it's more so that using python is the cause ? @Dtynin