Hi all,
I am not really a programmer by trade, and trying to get some stuff that I think is considered basic, but not really sure what to search for or how to go about, so bare with me if it's not super clear.
I'm using an Arduino Uno, just using their IDE for programming a few small functions.
One item that I'm having trouble with is the Serial.readStringUntil('\n') command.
It works as intended (read a string, put it into a variable, end at new line). But I'm having difficulties reading a specific value inside of the string.
I will get some lines of code, such as "Value1", "Value2", and "Generated + X" where the X is randomized value that keeps changing.
The readStringUntil('\n') works great for the first 2, as it calls the appropriate functions once it reads them, but once i get the "Generated " line, it doesn't always work because if the X value changes, it no longer sees the string as something specific.
So is there a way to read the entire line, but then parse through it for a specific string (like once it reaches the end of Generated" it knows the line is what I'm looking for?
I am not really a programmer by trade, and trying to get some stuff that I think is considered basic, but not really sure what to search for or how to go about, so bare with me if it's not super clear.
I'm using an Arduino Uno, just using their IDE for programming a few small functions.
One item that I'm having trouble with is the Serial.readStringUntil('\n') command.
It works as intended (read a string, put it into a variable, end at new line). But I'm having difficulties reading a specific value inside of the string.
I will get some lines of code, such as "Value1", "Value2", and "Generated + X" where the X is randomized value that keeps changing.
The readStringUntil('\n') works great for the first 2, as it calls the appropriate functions once it reads them, but once i get the "Generated " line, it doesn't always work because if the X value changes, it no longer sees the string as something specific.
So is there a way to read the entire line, but then parse through it for a specific string (like once it reaches the end of Generated" it knows the line is what I'm looking for?
Last edited by a moderator: