DaneSlattery / hx711

A no-std rust library for the ESP32
GNU General Public License v3.0
6 stars 5 forks source link

Issue with multiple tarings #1

Closed beeb closed 10 months ago

beeb commented 11 months ago

Hey there! Thanks a bunch for this library, it fits exactly what I needed.

I noticed a little problem, when calling the tare() function multiple times. It seems you use read() to get the value to be put as the offset, but read() itself already accounts for any previously existing offset.

So when performing the second tare, the weight is not reset to zero. Hope this makes sense! You probably need a function that can get you the raw reading without applying the offset. Maybe the offset should only be applied in the read_scaled() function.

Thanks again!

PS: are you open to contributions?

DaneSlattery commented 11 months ago

Hi Beeb, I am open to contributions, but I am planning to fix this particular bug tonight and improve the documentation.

beeb commented 11 months ago

Awesome! Thanks. I'll keep using the lib and maybe make a PR if I find something that needs fixing. For now it's smooth sailing :)

DaneSlattery commented 11 months ago

PR done from my side, let me know if that addresses your needs!