Hello
I know there are other posts detailing how this should work. Unfortunately I am missing something because they do not seem to work for me.
I am passing a numeric string e.g 109255125130 to my function, I am then using substring to parse out the elements for later usage (* this is not full code, just a snippet)
int ledToggle(String command) {
String action=command.substring(0,1);
String AAled=command.substring(1,3);
String red=command.substring(3,6);
String green=command.substring(6,9);
String blue=command.substring(9);
I then need to convert the substring âpartâ into an actual integer so
int lednum = 0;
lednum = AAled.toInt();
At this point (along with the remaining parts of the code), compiling completes without issue. no errors.
However, if I then attempt to use âlednumâ as a component in additional downstream processing such as
Particle.publish(âactionXXâ, lednum, PRIVATE);
I get âinvalid conversion from âintâ to âconst char*â [-fpermissive]â; I do not understand the error, nor how to go about fixing it.
Can anyone put me out of my misery please?
Thanks
Tony