Obtaining separately R G B from the input

Hello,
i have an addressable LED strip and i need to get a separate color to set the color of the strip but i don't know how to separate the numbers.

String:
Example:
String rgb = "255.50.150)" (Please note that the number can be from 1 to 255 and can be 1 to 3 numbers long)

I need to get strings R, G and B separately from this

Have a nice day,
Dj Nejk

Look up strtok() and atoi()

marco_c:
Look up strtok() and atoi()

But they don't work with Strings

Can't String be converted to a c-string?

[EDIT] String to do equivalent is .indexOf(), .substring() and .toInt(). I would recommend search for "Arduino String" to see what methods are available to manipulate the text.

My question would be why is OP starting with ANY type of ASCII representation?

gfvalvo:
My question would be why is OP starting with ANY type of ASCII representation?

The notorious reply when asked for directions to somewhere
"If I was going there then I wouldn't start from here"

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.