doorlock.write(0);
String passcode = "34214";
String dataEntered = "";
for (int i = 0; i < 5; i++)(
while (1)(
String x = buttonRead();
if (x != "nothing")(
dataEntered = dataEntered + x;
break;
}
}
delay(200);
}
if (passcode == dataEntered)(
doorlock.write(180)
Serial.printin("Press button #1 tp lock");
while (1)(
if (digitalRead(button) == 0)(
break;
}
else()
}
Sorry, but what is codenif.
tyty1107:
Sorry, but what is codenif.
I am sure that D_G meant please post complete code if you want complete help.
So im making an esapce room with my school and the is for a code lock that runs a servo.
Then what did he mean.
UKHeliBob:
I am sure that D_G meant please post complete code if you want complete help.
What part of that isn't clear?
i'm sorry, the week i have been trying to learn but non of it is sticking so i have idea what anything means.
tyty1107:
i'm sorry, the week i have been trying to learn but non of it is sticking so i have idea what anything means.
Let's keep it simple.
Post your complete program not just part of it.
Is what you posted in your first message ALL the code there is? Meaning is it the complete .ino file or did you only copy / pasted a portion of it?
If what you posted is all there is, then it definitely won't compile. If there's more, then POST THE WHOLE THING.
that is all of it.
So what should i do to complete the code
what is wrong with the code why won't it compile
It's not a program, just a few odd lines of code. Specifically you have no setup(), no loop(), no includes, no definition of doorlock and no Serial.begin().
Come back when you've fixed those and we'll try again.
Steve
doorlock.attach(10);
}
void loop(){;
int doorlock.write(0);
String passcode = "34214";
String dataEntered = "";
for (int i = 0; i < 5; i++){
while (1){
String x = buttonRead();
if (x != "nothing"){
dataEntered = dataEntered + x;
break;
}
}
delay(200);
}
if (passcode == dataEntered){
int doorlock.write(180)
Serial.printin("Press button #1 tp lock");
while (1){
if (digitalRead(button) == 0){
break;
}
else()
}
Troll. I'm outa here.
I'm not a troll i gust have no idea what i'm doing. i need help.
tyty1107:
I'm not a troll i gust have no idea what i'm doing. i need help.
what is the source of your code?
i dont know what that is.
Thanks for your help i found a different way to do it with a keypad.
tyty1107:
Thanks for your help i found a different way to do it with a keypad.
As a matter of interest are you still using an Arduino ?