52 hx711Sensor.setTareOffset(tareOffset);
53 uint64_t stabilizingTime = 2000;
55 hx711Sensor.start(stabilizingTime, _tare);
56 if (hx711Sensor.getTareTimeoutFlag()) {
57 SUPLA_LOG_DEBUG(
"HX711 timeout, check connection");
59 calFactor = (calValue > 0) ? calValue : defCalValue;
60 hx711Sensor.setCalFactor(calFactor);
61 SUPLA_LOG_DEBUG(
"HX711 startup is complete");
63 uint32_t wait = millis();
64 while (!hx711Sensor.update() && millis() - wait <= 100) {}
65 SUPLA_LOG_INFO(
"HX711 calibration value: %.2f", hx711Sensor.getCalFactor());
67 "HX711 measured conversion time ms: %.2f",
68 hx711Sensor.getConversionTime());
70 "HX711 measured sampling rate: %.2f HZ", hx711Sensor.getSPS());
72 "HX711 measured settling time ms: %d", hx711Sensor.getSettlingTime());
73 channel.setNewValue(getValue());