I've been testing my huzzah 8266 with the "Simple HTTP get webclient test" provided on the adafruit site. I was hoping to clear some confusion, namely:
while(client.available()){
String line = client.readStringUntil('\r');
Serial.print(line);
}
I was reading from a txt file on my site which is completely empty aside from the word:
red
I tried to manipulate the String variable, line, in an if statement; but it looks like the false branch is always launched
Serial.print(line);
if (line == "red"){
Serial.print("\n\n Red has been detected");
}
else{
Serial.print("false")
}
strange enough; in my serial monitor, it will print the word red. However, the else statement is always launched and I always see "False" printed inside serial monitor. I have a feeling it has to do with carriage return, however, I don't think I understand what exactly is a carriage return. Is it safe to assume that carriage return is the same thing as saying end of file? (EOF)?