Quick help with code - changing serial output

Hello,

I am kind of stuck with my Arduino code, I need quick help. I have a code that prints values from 15 photo resistors, and right now it prints it like this:

Sensor 5:818
track5
Sensor 6:0
Sensor 7:1023
track7
Sensor 8:964
track8
0
Sensor 9:track9
Sensor 10:84
track10
Sensor 11:164
track11
Sensor 12:1023
track12
Sensor 13:912
track13
Sensor 14:789
track14
Sensor 15:825
track15

I would need to change that so that it prints a string like this: "818,1023,964,0,84,164,164,1023,912,789,825,.........", and this would repeat every time the values come in, only the actual sensor values, without the sensor number and the track number.

Attached is my code.

Any help would be great,
Thanks!
Tommy

laserctrl.ino (15.1 KB)

Any help would be great,

Surely you can figure out how to make the trackN messages stop happening.

Surely you can figure out how to make the Sensor N messages stop happening.

Surely you can figure out how to make the new lines stop happening.

The ONLY challenging part is not printing a comma after the last value.

@PaulS Yeah, I'm sorry. I figured that out. So... what about the comma?

So... what about the comma?

What about it? Serial.print() a value. Serial.print() a comma. Repeat as required, except the last time, don't print the comma.

Do not cross-post. Other thread removed.

Are you sure the last (superfluous) comma actually causes a problem ?

The receiving program could just ignore it.

...R