Created
October 14, 2013 07:09
-
-
Save rkrishnasanka/6971895 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void explode(String message) | |
{ | |
int count = 0; | |
do | |
{ | |
commaPosition = message.indexOf(':'); | |
if(commaPosition != -1) | |
{ | |
Serial.println( message.substring(0,commaPosition)); | |
// clipping off the message string | |
message = message.substring(commaPosition+1, message.length()); | |
} | |
else | |
{ // here after the last comma is found | |
if(message.length() > 0) | |
Serial.println(message); // if there is text after the last comma, | |
// print it | |
} | |
} | |
while(commaPosition >=0); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int stringToNumber(String thisString) { | |
int i, value, length; | |
length = thisString.length(); | |
char blah[(length+1)]; | |
for(i=0; i<length; i++) { | |
blah[i] = thisString.charAt(i); | |
} | |
blah[i]=0; | |
value = atoi(blah); | |
return value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment