tatobari / hx711py

HX711 Python Library for Raspberry Pi.
Apache License 2.0
206 stars 154 forks source link

fix high cpu load problem + apply flake8 rules + fix is syntax #46

Open devprofile98 opened 2 years ago

devprofile98 commented 2 years ago

1 - using pass in while when checking for ready on line 115 causes high CPU load, something around 100% CPU use, a small sleep will release CPU clocks for good use. 2 - use of is for comparing two number in python is wrong and == should be replaced. 3 - flake8 rules applied to make python code more readable and clean

tatobari commented 2 years ago

Hi! Thanks for the PR. I'll check it out by the end of the week. I'll also submit a whole new version based on interrupts instead of a loop that waits, in order to avoid freezing the CPU while waiting for the data line to go LOW, so I'll pull this into the new version as well.

devprofile98 commented 2 years ago

Hi, sounds amazing, we are waiting. 🤘

On Mon, 13 Dec 2021, 21:49 Tato Barilatti, @.***> wrote:

Hi! Thanks for the PR. I'll check it out by the end of the week. I'll also submit a whole new version based on interrupts instead of a loop that waits, in order to avoid freezing the CPU while waiting for the data line to go LOW.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tatobari/hx711py/pull/46#issuecomment-992745068, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK466X4ABAMTDEQ524CXTYTUQY2L5ANCNFSM5JL3OOJQ .

AddisonG commented 1 year ago

Still waiting on this

devprofile98 commented 3 weeks ago

Hi, I am here again after about 3 years, do you have any plans about this pull request? or should I close this PR?