crjeder / hx711_spi

This is a library for the hx711 chip. It uses SPI instead of bit banging for more reliability.
MIT License
14 stars 4 forks source link

Using two channels simultaneously #21

Closed pronvis closed 1 month ago

pronvis commented 1 month ago

HX711 have two channels: A & B. Is it possible to connect two measurment devices simultaneously and use your library?

crjeder commented 1 month ago

Yes it is possible with the set_mode function, but the maximum sample rate would drop to 1/3. This is because I implemented the mode / chanel change. Per datasheet the mode is changed after the read for the next time. To take effect immediately I added a read. How would you like to use it? I am working on the 1.0 version and could easily change the behavior.

pronvis commented 1 month ago

Wow, awesome! Could you provide some example of how to use it in that case please?

How would you like to use it? I have 4 DYMH-106 and want one BluePill to get data from them and then send that data via bluetooth to some "motherboard". But bluepill have only 3 SPI interfaces.

crjeder commented 1 month ago

Ok. The hx711 is not made to read several load cells. The second channel is meant for e. g. an analog temperature sensor. It is not as sensitive as the first channel. I've added a basic example for using both channels in the documentation / comment of the set_mode function

pronvis commented 1 month ago

Got it, thank you! Btw, I could not find "basic example for using both channels in the documentation of the 'set_mode'"