Serial communication slight problem using Wemos D1 R2 and UNO + ThingSpeak

Robin2:
Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.

The way you are sending and receiving the data in the programs in your Original Post you have no means to know which item of data is which. Look at how it is done in the 3rd example in my tutorial. You can send data in a compatible format like this

Serial.print('<'); // start marker

Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker




...R

Thanks for replying and sorry for not replying so long.
i kinda get how to receive it by using the marker example but the problem is the sensor data needed to upload to thingspeak needed to be converted into string. since i only know how to upload all three values instead of one each time, its hard to convert value of each array into string.

i used the code in Serial input basics in example 3 and
this is what i can think of:

recvWithStartEndMarkers();
String s1 = String(receivedString[0]);
String s2 = String(receivedString[2]);
String s3 = String(receivedString[4]);
uploadThingSepak();

and this is the recvWithStartEndMarkers code:

String receivedString[ndx];
String senser;
 
    while (Serial.available() > 0 && newData == false) {
        rc = Serial.read();

        if (recvInProgress == true) {
            if (rc != endMarker) {
                receivedChars[ndx] = rc;
                senser = String(receivedChars[ndx]);
                receivedString[ndx] = senser;
                ndx++;
                if (ndx >= numChars) {
                    ndx = numChars - 1;
                }
            }
            else {
                receivedChars[ndx] = '\0'; // terminate the string
                recvInProgress = false;
                ndx = 0;
                newData = true;
            }
        }

        else if (rc == startMarker) {
            recvInProgress = true;
        }
    }

but this code might get the wrong data to upload since i just guessing which index the data belong to also how to empty the receivedString array after i get all the data then uploaded it.

Thanks in advance