dj_nejk
February 24, 2021, 6:23pm
1
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
marco_c
February 24, 2021, 6:26pm
2
Look up strtok() and atoi()
marco_c:
Look up strtok() and atoi()
But they don't work with Strings
marco_c
February 24, 2021, 6:43pm
4
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.
gfvalvo
February 24, 2021, 6:52pm
5
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"
system
Closed
June 24, 2021, 6:57pm
7
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.