hx711 icon indicating copy to clipboard operation
hx711 copied to clipboard

Replace with a virtual waitReady method

Open endail opened this issue 4 years ago • 1 comments

https://github.com/endail/hx711/blob/de87c5b54282c7e86e214a7ec04d64beda106735/src/HX711.cpp#L257-L265

The waitReady method should busy-wait for a predefined maximum amount of time. If the amount of time is exceeded, a TimeoutException should be thrown. The try-catch in setConfig can then handle accordingly.

Inheriting classes like AdvancedHX711 can then override with something else as needed.

This will also handle the case where DOUT is never "ready" for some unforeseen reason.

endail avatar Dec 06 '21 13:12 endail

AdvancedHX711 relies upon Watcher, which - currently - does not easily allow for notifications when data is ready. A rewrite may be in order. Perhaps event-based callbacks?

endail avatar Dec 15 '21 14:12 endail