So im trying to learn how to store my results, instead of serial.print. I dont have a specific example, but i run into it alot, and I dont know what I should even search for.
example....
if statement
serial.print ("1");
serial.print ("2");
serial.print ("3");
another if statement
serial.print ("4");
serial.print ("5");
serial.print ("6");
I am trying to get results from first and connect them to second. Again, no specific code, not looking for someone to fix my code, just tell me what its even called so I can search for info. I literally dont know what I dont know.
This is generally called data processing. The data is very often stored in something called a structure, often there are multiple structure formats with the start being common as in length and type followed by the types fields. Data can be stored on SD cards, hard and solid state drives, cloud servers and very often today in some sort fo SQL DB. A very good foundations book is https://amz.run/9V5r
just so I can collect the info from if statements, and then serial.print them all at once.
like now i would get
123
123
123
ABC
ABC
ABC
and I want to collect the values of each, then display 123ABC (random example). Im pulling data from different sensors and want to just put the data together in one line. Maybe like a part number would be a good example. If I got data from first statement that told me part number started with AB, and then another gave date or something. And the goal would be to format it to AB2024. Sorry if im terrible at explaining it.
Note that an array of variables can only hold data of a single type so if you want to save a string such as "ABC" and an integer value of 123 then they cannot be saved in the same array. You can, however, use two (or more) arrays, one for each data type
There is also a neater way of doing it using structs, but I am not sure of the data type or types that you need to store so I will not go into that at the moment