Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read function #11

Open
Swompet opened this issue Mar 9, 2020 · 4 comments
Open

read function #11

Swompet opened this issue Mar 9, 2020 · 4 comments

Comments

@Swompet
Copy link

Swompet commented Mar 9, 2020

Hello,
my values that I get are kind of inacurate.
So I debuged the read function. This is the output:
data: -459753 | data: -459702 | data: -459744 | data: 5307 | data: -459832 | sum read: -1833724 | Units : -4.040000
data: -459705 | data: -459789 | data: -459790 | data: 5421 | data: -459839 | sum read: -1833702 | Units : -4.040000
data: -459685 | data: -459687 | data: -459728 | data: -459731 | data: -459694 | sum read: -2298525 | Units : -0.000000
data: -459751 | data: -459752 | data: -459734 | data: -459759 | data: -459747 | sum read: -2298743 | Units : -0.000000

You can see that the data is kind of wrong sometimes.
Also I noticed while printing that to my screen that there is a small delay when the data is wrong.
Do you habe any idea how to fix that? thank you

@dangrie158
Copy link
Owner

Hi,
I'm currently not able to quickly test any changes, but I have a suspicion.
could you please change Line 71 in hx711.cpp to:

read |= 0xFF000000UL;

then recompile the lib and try again? If it works I can issue a patch to help others with the same problem

Thanks!

@Swompet
Copy link
Author

Swompet commented Mar 11, 2020

Hi,

i guess you mean "data |= 0xFF000000UL"?

@dangrie158
Copy link
Owner

A, yeah sure! (y)

@aqmattil
Copy link

Hi,

I've encountered similar issues with getting some odd readings between 'correct' ones. For example, I'm getting quite stable readings between 1.25 and 1.35 (I think the actual values are not important here), and every now and then a reading of -8.78... What's odd is that the negative value is always the same (the value changes with different settings, but after initing the load cell the negative value doesn't seem to change). Fwiw, the 'spike' is always below the readings, never above.

I tested this with different load_cell_read_times (1 reading, 3 readings) and with different read_intervals (100 ms and 1000 ms) with same results.

I applied the patch mentioned above (data |= 0xFF000000UL), but it didn't solve this issue. It might've made the odd readings rarer (before the patch I sometimes got multiple negative values in a row), but I might be imagining this.

Is there anything else that I could try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants