I can't figure this out.
First I am receiving this string over serial...
&&
01511000.00
01522000.11
01533000.22
01544000.33
01555000.44
01566000.55
!!
Each line is terminated with a CR and LF
I want to detect when the String = "&&" and parse the data for storing on a SD.
Trying this to detect the && and then print it to prove i can detect it but the if statement always evaluates as true. What is wrong with this?
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
}
void loop() {
String s2;
if (Serial1.available() > 0) {
String s1 = Serial1.readStringUntil('\n');
s2 = s1;
if (s2 == "&&"); {
Serial.println(s2);
}
}
}