If there are just two positions for the elevator then a simple push-button switch will work fine.
You need a variable to record whether the elevator is at the top, the bottom or movingUp or movingDown ('T' 'B' 'U' and 'D')
then the button control logic would be something like this
void (checkButton) {
buttonPressed = digitalRead(buttonPin);
if (buttonPressed == LOW) { // assumes LOW when pressed
if (motorState == 'T') {
motorState = 'D';
}
if (motorState == 'B') {
motorState = 'U'
}
}
}
and the motor move logic would be something like
void motorMove() {
if (motorState == 'U') {
// code to move up one step
topLimitState = digitalRead(topLimitPin);
if (topLimitState == LOW) {
motorState = 'T';
}
}
// similarly for going down
}
...R