I am after some general programming guidance, I have a need to measure a variable number of 1-wire temperature sensors. The sensors won't be hot-swapped etc but one project might need 3 sensors whilst another project might need 8 sensors.
I had a look at the libraries that exist, and whilst a number do exist for the 1-wire they tend to be more about scanning the device addresses, or using a fixed address to report a temperature.
I would like to output the temperature and the address as a delimited string, so thought I could loop through the address finder, then with the address find the respective temperature for that address.
What I am a bit lost about is how to report this, for simplicity on the PC side I would like to do a string something like address;temperature,address;temperature,address;temperature and process that on the PC but if I use the address finder approach it would be more like
which I would prefer not to do if possible, is the easiest way to store the address;temperature in a string and then just print the string?
String stringOne = ""; // loop through 1-wire here stringOne += Address; stringOne += ";"; stringOne += temperature; stringOne += ","; //loop to next
Is there a better way to achieve this, am I reinventing the wheel or are they any major issues anyone can foresee?
Conside the above pseudocode as well, I have just done it off the top of my head.