Hello!
I am measuring weight with two load cells and hx711.
I am getting clean numbers of two weights (0,5 kg or 1 kg). I want to calculate how much percent of weight is on every cell, so 50% and 50% if I put 0,5 kg on every cell or 33% and 66% if I put 0,5 kg on one and 1 kg on another cell.
The funny thing is that I never get 100% as result. If I put only one weight on cell I can read load of 1 kg for example but percent is always 99% (should be 100%). Also, if I put 1kg on every cell I don't get 50% and 50% but 49% and 50%. I have no idea why
I am using byte variable for percent and float for weight. I tried with int also but it didn't help.
I am calculating percent like this:
percent1 = ((weight1 * 100.0) / weightSum);
percent2 = ((weight2 * 100.0) / weightSum);
I just tried to multiply with 101 instead of 100 and now it works as it should, I get 50-50% or 100%. Anyway, I don't understand why.