Char comparison doesn't work

Hello again!!

I'm sending an AT+CIPSEND=100 command to my ESP. As you may know, the response coming from the module is a '>' char.

Though it is indeed returning it to me, when I try to compare it with a char, string, char[], char* or anything else, it passes by through the condition and it's done.

I'm a bit confused on why this is occuring.

Thanks in advance!

And your code looks like?

We can promise you that char comparison does work

char a = '>';

If (a == '>') { 
// do something
} else {
// do something else

and string comparison work (use the strcmp function) too...

So you probably did not try it all...

Hi J-M-L,

Thanks for your prompt help. It saved me a lot on my previous post.

I tried using strcasecmp, but somehow it didnt match either.

I tried Serial.find() which search for a char inside a while loop

while ( true )
     Serial.find( '>' );

The first step is to forget that Serial.find() exists. Seriously, I had to look at the reference to be sure you hadn't just made that up.

Then read Serial Input Basics (Updated)

Breno999 provided this:

while ( true )
     Serial.find( '>' );

which is an infinite loop.

The logical condition of the while is always true, and the result of the Serial.find('>') is thrown away without explanation. It will just keep looking, and looking, and looking, and...