Hello everyone.
I have searched everywhere and tried implementing compiled variants to no avail.
Long story short: I am receiving a wireless signal that contains 5 discrete sensor values and I want to split them, route them, and display them accordingly.
Here is the significant snippet from the transmitter portion:
// Combine all sensor readings
str_out = str_Ctemp1 + "," + str_Ftemp1 + "," + str_Ctemp2 + "," + str_Ftemp2 + "," + str_humid;
From the serial monitor I get this:
Hum = 0
22.00,71.60,23.00,73.40,16.00*
C = 21.25
F = 1.25
C2 = .25
F2 = 25
Hum = 5
21.25,70.25,23.00,73.40,16.00*
C = 21.75
F = 1.75
C2 = .75
F2 = 75
Hum = 5
21.75,71.15,23.00,73.40,16.00*
Clearly the received transmission on the serial monitor is intact given this line: 21.75,71.15,23.00,73.40,16.00* (How do I get rid of that pesky asterisk BTW?)
Now I have the receiver code snippet here:
// Split string into five values - HOW??????????
for (int i = 0; i < str_out.length(); i++ ) {
if (str_out.substring(i, i + 1) == ",") {
str_Ctemp1 = str_out.substring(0, i);
str_Ftemp1 = str_out.substring(i + 1);
str_Ctemp2 = str_out.substring(1, i);
str_Ftemp2 = str_out.substring(i + i);
str_humid = str_out.substring(2, i);
break;
}
}
It is clear to me as to how to SPLIT a string into TWO...
// Split string into two values
for (int i = 0; i < str_out.length(); i++) {
if (str_out.substring(i, i+1) == ",") {
str_humid = str_out.substring(0, i);
str_temp = str_out.substring(i+1);
break;
}
}
What if I want to decode MORE than just 2?
The (0,i); + (i+1); thing doesn't seem to work for fore than 2 values. ![]()
How would the code need to be written? ![]()
I adapted my code from this example shown in this URL: Using 433MHz RF Modules with Arduino | DroneBot Workshop
P.S. I don't know what I am doing and I am humbled by the Arduino gurus in here because I'm a noob.
Thank you in advance. ![]()

