endail / hx711

Raspberry Pi HX711 C++ Library
MIT License
18 stars 10 forks source link

Using both channels, hx711 is wired two sensors. #87

Closed seliimsi closed 3 weeks ago

seliimsi commented 2 months ago

Hello, Does the library make it possible to use both channels on same pins, changing the channels alternately ? For instance Can I create two different objects with same inputs except the channel input as it follows:

Hx711 hx1(data,clock,..channel='A'); Hx711 hx2(data,clock...channel='B');

Something like this.. ?

endail commented 2 months ago

Hi,

The HX711 is only capable of reading from one channel at a time. To be able to read from a different channel, the HX711 needs its configuration to be changed on the chip.

It would be best to create a single HX711 object and use the setConfig method to change between channels.

Also keep in mind that Channel A can use a gain of 128 or 64. Channel B can only use 32.

seliimsi commented 1 month ago

Thank you so much

seliimsi commented 1 month ago

Hello, I tried with common CLK pin and different data pins. This type of configuration works well on rp3. The issue can be closed, your library fit best for my application. Thanks again..