I need help in getting data from the web server code.
I am sending words to a web server using the Ethernet web server code from the 1st Ethernet shield and need the 2nd Ethernet shield to get specific word (eg. Yes) from the web server (using the web client code).
However, I am not able to do so. I try using :
if (client.available())
{
char c = client.read();
if(c=='Yes')
{
Serial.print("Yes obtained");
}
if (client.available())
{
char c = client.read();
if(c=='Yes')
{
Serial.print("Yes obtained");
}
Until the client.read line you are doing fine, but you are trying to compare a char (a single letter like 'Y') to a word "Yes", so it will never be true...
To do that you will need to check the first letter ('Y'), then the second letter ('e') then the third letter ('s'). This is called a state machine.