est3
October 22, 2019, 9:29pm
1
Hi, i wrote this code
String act;
void setup(){
Serial.begin(9600);
Serial.println("conected");
}
void loop(){
if (Serial.available()>0)
{
act = Serial.readString();
if (act == "on")
{
Serial.println("==, on");
}
if (act.equals("on"))
{
Serial.println("equal, on");
}
}
}
the problem is, that even if i send in the monitor on it's not recognize it.
Is someone know what the problem?
i use pro mini, if it's importent.
est3
October 22, 2019, 9:44pm
3
TheMemberFormerlyKnownAsAWOL:
Your code is incomplete.
if (act == "on"")
Oops
you are right, but the mistake is in what i type here, in the sorce it's ok and the code compile.
Ok, when you've got a relevant question, and the code to go with it (not pictures), get back to us.
est3
October 22, 2019, 9:55pm
5
TheMemberFormerlyKnownAsAWOL:
Ok, when you've got a relevant question, and the code to go with it (not pictures), get back to us.
All the code write in my first mesage, i atached picture to show that the mistake is was here, and not in my orginal code, and i have problem, . i wrote it in my first massege, mabey it's not cleraly, its because my english not very well.
The code in the first post doesn't compile for a number of reasons, the most obvious of which is that it is incomplete.
Change the "Line Ending Feed" of the Serial Monitor to "None"
est3
October 22, 2019, 10:24pm
8
TheMemberFormerlyKnownAsAWOL:
The code in the first post doesn't compile for a number of reasons, the most obvious of which is that it is incomplete.
you right, because the tiredness (the time in my city is 1:19 at night...) i forgot two '}'.
est3
October 22, 2019, 10:31pm
9
arduino_new:
Change the "Line Ending Feed" of the Serial Monitor to "None"
it's working thank to both of you.
now i need to see why it's not work with the max485... but i think this will be only tomrrow...