Skip to content

Instantly share code, notes, and snippets.

@smetronic
Created December 16, 2017 15:26
Show Gist options
  • Save smetronic/c0d4fdb68adfd859d09af15328e46e9c to your computer and use it in GitHub Desktop.
Save smetronic/c0d4fdb68adfd859d09af15328e46e9c to your computer and use it in GitHub Desktop.
ATMega 328p: Read characters after keyword
void setup() {
Serial.begin(9600);
String stringValue;
String stringValue1;
String stringValue2;
stringValue = "ReadData: 1997";
int index = stringValue.indexOf(':'); //keyword
stringValue2 = stringValue.substring(index + 2);
Serial.println(stringValue2); //1997
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment