Closed aero9560 closed 2 years ago
If you want the weight as a number you just need to cast the Mass
object to a float like this:
val = float(hx.weight())
But if you just want the raw numbers from the scale which haven't been adjusted according the calibration settings (reference unit and offset), you can use either:
hx.getValues()
and pass in:
datetime.timedelta
).OR
hx.read()
with an optional Options
object like you have done with .weight()
.A third option, if you just want to adjust a raw value according to calibration settings, is to use hx.normalise(raw_value)
. So you could do something like:
for val in hx.getValues(10):
print( hx.normalise(val) )
Hello Thanks for previous reply that were very helpful. I am using tkinter interface to show weight . Is there a way by which measured weight shown on tkinter window remain stable not like always blinking.
Unfortunately I don't have any experience with tkinter, so I can't help with that.
hello Is AdavancedHX711 not available for python. I am getting invalid syntax for hx = AdavancedHX711(27, 17, 198227, 114496, Rate::Hz_80). or i have to remove the jumper first then use AdavancedHX711.
The Rate::Hz_80
part is the problem. That's C++ code. Try this:
hx = AdavancedHX711(27, 17, 198227, 114496, Rate.HZ_80)
Hi My 1000 kg load cell output keep fluctuating ( between 0.0 and 0.1). Do yo have any suggestion regarding this. Does increasing the excitation voltage will help(current using voltage from hx711). Thanks
You could try increasing the number of samples obtained, either by using a larger number when you call hx.weight(samples)
or using a longer timeout period hx.weight(timedelta(seconds=3))
.
If that doesn't work, you might need to look at using some kind of statistical function which smooths-out or can tolerate those fluctuations. But this library doesn't include that functionality.
How to tare the scale? Please help
hx.zero()
Hello Thanks for update, now options are working perfectly fine . i want to perform some function on reading obtained for load cell but as hx.weight return a object i can't do that, is there a way to converts raw reading obtained from hx.read to convert them to reading like obtained from hx.weight so additional operation can be done on them. Thanks