hx711
hx711 copied to clipboard
Replace with a virtual waitReady method
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.
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?