HX711 icon indicating copy to clipboard operation
HX711 copied to clipboard

Running two instances of HX711.h

Open stevethestrain opened this issue 6 years ago • 1 comments

Firstly, @bogde thanks for this excellent library. I can't get scale.set_gain to go into the 32 scale mode with a scale.set_gain(32) call but that's probably me being stupid. I'd like to use two HX711s (I got 5 boards from Amazon for about 10 /euros) ! The first, connected to a load cell, is working perfectly. I'm using it to control a linear actuator to force a BLDC motor driven drilling machine into work. What I'd like to do is use a precision low value resistor in series with the motor supply to measure current draw. I don't think it will be to difficult to get the HX711 to see and amplify the voltage drop across the resistor - probably common Gnd and one SG I/P and use the other to see the volt drop - which will only be a few mV,

But my question is - can I call two instances of the library with two HX711s (obviously connected to different pins !) so I call one exactly as I'm doing at the moment to get load and tare and then call the other to get 'tare' - volts zero offset - and 'load' which will be voltage drop and therefore current. Hope that makes sense !

stevethestrain avatar Aug 31 '18 14:08 stevethestrain

I have the same desire. I figure that a developer by default should design a class to be able to be instantiated at least twice.

kenneth558 avatar Dec 16 '18 09:12 kenneth558