I'm working on developing a project where I am going to be logging from several identical sensors, in total it will be about 10 variables (all float). I have the project up and running locally and the data from the sensors get stored in an array, as it seems to be the logical way to do it. I'm trying to modify this to log the data to the IoT cloud, however I've been unable to locate in the documentation if arrays are supported in Arduino's IoT cloud. Does anyone know if you can send arrays to the Arduino IoT cloud? If not what might be some possible solutions?
Here is some pseudocode for the way my sketch is written:
Unrolling the for loop. I do understand that this allows the compiler to save memory, the code to run faster, and that under the hood the compiler does this. It just seems like it'd make the code a lot harder to understand.
Concatenate all the data into a string (not ```String()``) variable with a delimitator and upload that data to the IoT cloud and then parse it later during analysis. Essentially each update of any of the variables causes a new line to be written.
You will need 10 individual variables tied to the cloud IoT. You could also create one large, comma delimited string but that will take some post processing
Thanks. I suspected they weren't supported, but wanted to check (IMHO the cloud variables documentation could be better).
I'm not super familiar with C/C++/Arduino so this may be a dumb thought for an alternative option. Could you use pointers in some way? Essentially make a pointer for each cloud variable, and then put them in an array (e.g. pointerArray) and loop through the data array (e.g. dataArray) and then set the values that way?
I'm thinking I may go the comma delimited string route as I'm using a temperature/humidity sensor so it makes sense to keep the readings together.
I may be way way off here, but would ten separate variables and an array of references work. It would be a little extra setup but the rest of the code could just pretend it's a regular array.