Time required for serial communication with HX711 vs Qwiic Scale?

Hi. I am using the HX711 breakout in a project that requires sampling the weight at a rate of 100 samples per second. The microcontroller is a Sparkfun ATmega32U4 breakout running Arduino. I already figured out that I need to use a crystal to get the HX711 to sample at rates higher than 80 sps. I’m going to order a 13.824MHz crystal.

But I noticed that the communication with the HX711 takes up about 3ms, when I run this line of code:

Serial.print(scale.get_units(), 1);

Together with the rest of my code, that puts me over the 10ms desired sampling interval.

Is there a way to make this go faster? By editing the HX711 library, perhaps? Would I get faster communication if I use the Qwiic scale instead? (A different I2C device that I am using - not for weight - takes 2ms to do a read, but I haven’t tried the Qwiic scale.)

Thanks for any advice!

Nathan Chronister

Please disregard. I found that the function scale.get_units() was waiting for the hx711 to be ready to be read. The read actually takes only about 390 microseconds if it doesn’t have to wait. Still a little tricky to make sure you don’t call the function at the wrong time and end up waiting.