martinayotte wrote:Luiz Henrique wrote:This code really works for me, BUT i need a other trouble.
I need to use a decision with a my response.Code: Select allString tratado = resposta;
if (tratado="OFF")
In my case, he always print "OFF". typing same ON or OFF. I need to clear the buffer or the cache always in end of loop? How i can do this?
I think you need to learn a bit more about C/C++ ...
The code " if (tratado="OFF") " totally doesn't do what you wish.
You may use double equals, but since maybe other characters can follow the OFF, such \r\n, the equal probably won't succeed either. You need to do " if (resposta.startWith("OFF")) " instead.
Hmmm, i understand. Srry for my bad. I will test tonight and i tell u