this is a general question. I was wondering whether is it possible to extract the main while(){} loop into a separate function (without endless loop). The idea is to have that separate function being called from the main Arduinos loop.
End goal is to have Arduino doing more in its loop. By doing so I will avoid placing more Arduinos logic into the Azure IoT Hub related functions. For example - reading from various external sensors and sending real data. I am having hard time putting that loop into its own function. Seems like the serializer has some issues - I cannot serialize data when in another function.
The very simple sample I would like to achieve is - having my Arduinos loop in which I read sensor data and send these values to the IoT Hub. I am unable to extract such logic in its own function. Of course everything while maintaining integrity (the state of my already created model).
All of the C samples do have this XXX_run() function which contains the endless loop. Is it possible at all to achieve what I am asking?
Hi,
this is a general question. I was wondering whether is it possible to extract the main while(){} loop into a separate function (without endless loop). The idea is to have that separate function being called from the main Arduinos loop.
End goal is to have Arduino doing more in its loop. By doing so I will avoid placing more Arduinos logic into the Azure IoT Hub related functions. For example - reading from various external sensors and sending real data. I am having hard time putting that loop into its own function. Seems like the serializer has some issues - I cannot serialize data when in another function.
The very simple sample I would like to achieve is - having my Arduinos loop in which I read sensor data and send these values to the IoT Hub. I am unable to extract such logic in its own function. Of course everything while maintaining integrity (the state of my already created model).
All of the C samples do have this XXX_run() function which contains the endless loop. Is it possible at all to achieve what I am asking?