Hi Rick,
I will need more than 124 seconds to complete a wake cycle for my Boron. Using your library, if I want to "pat the dog", do I simply need to call:
ab1805.loop();
periodically through my code? Or is there a better way of handling it?
I want the watchdog operating just in case.
Thanks
If you are blocking loop you can call it during your other lengthy operations.
However you should also consider why you are blocking loop for that long and possibly restructure to use a finite state machine or worker thread instead.
1 Like
Nothing blocking per se, it's just that my sensor sampling routine takes 150 seconds to complete. Then cloud upload adds more time. And so on. Just want to make sure I use the best practice.
Generally speaking I would use a worker thread for long sensing operations like that. The thread should only do the sensing and calculations; do the publish and other cloud operations in a separate thread or the loop thread.
@wineisgud4u if you go the worker thread way mentioned above, have in mind that this singleton generator page can generate ultra useful code for a worker thread (with a singleton pattern included). Give it a shot, you won't regret.
1 Like
Thank you all for the suggestions!!!