You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tested the example "HX711_full_example", in line 49, it was: scale.tare(); // reset the scale to 0
I found it was same in example on github, my question are:
due to the function's prototype in header file, there should be a parameter in the calling, even it was "0", and not be null?
`void HX711::tare(byte times) {
double sum = read_average(times);
set_offset(sum);
}
since the function's prototype has "set_offset(sum);" inside, so the comment should be "reset the offset to 0"?
The text was updated successfully, but these errors were encountered:
For 1: A default arguments was defined as void tare(byte times = 10); in the header file. So even if you call scale.tare(); with no argument still valid.
For 2: I believe the current comment is correct. Calling Tare sets the scale to Zero, but doesn't mean the OFFSET is set to Zero.
The subtraction of the read value minus the OFFSET is what makes your get_value() or get_units() function give zero.
I tested the example "HX711_full_example", in line 49, it was:
scale.tare(); // reset the scale to 0
I found it was same in example on github, my question are:
`void HX711::tare(byte times) {
double sum = read_average(times);
set_offset(sum);
}
The text was updated successfully, but these errors were encountered: