Pause a code.

Hey guys, i'm trying to figure out how to make my code pause until a reqirement is met/complete. For instance the code below as for an example, the 'enterNumberandsendSMS();' loop has a reqirement to enter a phone number on the keypad, then the number is confired by pressing '#', a message is sent to that number. Then the dooropens(); loop activates the servo motor and opends the door. How do I make the dooropens loop wait until the enterNumbersendSMS() loop is complete?

if(blabla)
{
enterNumberandsendSMS();
dooropens();
}

doesn't your enterNumberandsendSMS() function only return after all of those things have been done? Does it return a value indicating success/failure?

Posting actual code is far better than written descriptions of code...

Is the SMS message dependent on opening the door? Do you need some return value from the SMS message or any confirmation? Otherwise, just have your enterNumberandsendSMS() check all the criteria for opening the door and return a simple integer value like 0 for successful and 1 if not. Then test for that return value and if true then call doropens();

Have a look at the user input code in Planning and Implementing a Program

...R