How to make internal loop in an event ?
A little more detail, please.
my code for display ground, 1st flood and 2nd floor doesn't loop
because this is under an event. if my password is correct then it will indicated which floor the elevator in
vance142:
my code for display ground, 1st flood and 2nd floor doesn't loop
because this is under an event. if my password is correct then it will indicated which floor the elevator invoid guessPassword(){
if (password.evaluate()){
digitalWrite(ledPin,HIGH); //activates garaged door relay
digitalWrite(ledPin,LOW); //turns off door relay after .5 sec
lcd.print("VALID CODE"); //
password.reset(); //resets password after correct entry
lcd.clear();
lcd.print(" Welcome to");
lcd.setCursor(0,1);
lcd.print(" Int.Elevator");
delay(2000);
if (Dlevel_G == HIGH && Dlevel_1 == LOW && Dlevel_2 == LOW){
lcd.print("Ground Floor");
}
lcd.clear();
if (Dlevel_G == LOW && Dlevel_1 == HIGH && Dlevel_2 == LOW){
lcd.print("First Floor");
}
lcd.clear();
if (Dlevel_G == LOW && Dlevel_1 == LOW && Dlevel_2 == HIGH){
lcd.print("Second Floor");
}
This appears to be a cross post on an early post you made. Kill one of them and also learn how to use code tags, not quote tags, when posting source code. Nick Gammon's two posts at the top of this Forum explains things well.
vance142:
How to make internal loop in an event ?
That may not be the best way to approach the problem. Have a look at the code in several things at a time and in planning and implementing a program.
Both manage multiple actions with a single loop - the normal Arduino loop().
...R