door lock with Arduino and a servo

PaulS:

how do I do it most easily?

If the servo starts at 0, and rotates to 180(ish) to unlock:

    lockServo.write(180);

delay(howeverLongYouWant);
    lockServo.write(0);




If the servo starts at 180, and rotates to 0 to unlock, swap the first and third lines.

Falls off chair in amazement !

PaulS used the delay() command in a program. :slight_smile: Whatever next, code on the same line as an opening brace ?
As requested, though, it is the easiest way to do it, if not the best.