ignch90:
... I doubt it makes any difference.
Well, yeah, it does. Now we can see that unique_id is a String.
Here's a quote from the reference page for the String Addition Operator page, saying, essentially, "don't do that:"
int sensorValue = analogRead(A0);
String stringOne = "Sensor value: ";
String stringThree = stringOne + sensorValue;
Serial.println(stringThree);
results in "Sensor Value: 402" or whatever the analogRead() result is, but
int sensorValue = analogRead(A0);
String stringThree = "Sensor value: " + sensorValue;
Serial.println(stringThree);
gives unpredictable results because stringThree never got an initial value before you started concatenating different data types.
That page will probably clarify the correct coding for you.
I suspect that this code -
unique_id = "Id_"+ARD_LABEL;
sees "Id_" as a lower-case-"s" string, and adds 111 to its pointer's value and returns the result to unique_id, which is then interpreted as a capital-"S" String, showing everything from that location to the first null character that it encounters. But, I don't know - something else could be happening..
This stripped-down code, without the unnecessary #include directives, seems to work:
#define ARD_LABEL 111 // unique id for this board
String unique_id ;
String tempString;
void setup() {
// Initialize Serial
Serial.begin(9600);
while (!Serial); // wait for a serial connection
Serial.println("Parse Starter Project");
// String for unique_id
tempString = "Id_";
unique_id = tempString + ARD_LABEL;
Serial.println("Unique Label is: " + unique_id);
Serial.println("Done.");
}
void loop() {}
The concatenation in the Serial.println(), concatenating a constant string and a String variable, may not be entirely kosher, based on what I see on the reference page. It seems to work in this case, but it's probably wisest to avoid that construction, and, when you're concatenating Strings, concatenate only Strings.