Ignore a comandline

hi everyone, I'm new to this arduino world, I'm trying to make an elevator with a 360-degree motor, the first up command works, but I put a command to stop, and start descending, only he ignores these two commands, if anyone can send the most effective line of code for this case would be very grateful.

The way it works is you show us your code and THEN we will help you to get it right.

And since you haven't told us what motor you're using or how you're driving it or even what Arduino you have we couldn't write the code for you even if we wanted to.

Steve

#include <Servo.h>
Servo motor1;
Servo motor2;

void setup () {
motor1.attach(5);
motor2.attach(6);
}
void loop() {

}

void forward(){
motor1.write(180); //foward
motor2.write(70);
delay(200);
}
void backward(){
motor1.write(0);
motor2.write(105); //back
delay(10000);
}
void right(){
motor1.write(180); //spin <—
motor2.write(105);
delay(1000); //set time
}
void left(){
motor1.write(0); //spin <—
motor2.write(70);
delay(1000); //set time
}
Motor: Servo Motor 360 degrees
Arduino: arduino duemilanove

So in setup() you attach 2 servos but do nothing with them.

In loop(), which is the part of the program that runs over and over again, you do nothing at all.

What are you expecting to happen? And when? And how?

Steve

Also you have delay(1000) all over the place and that is going to prevent your program from responding to other things. Have a look at how millis() is used to manage timing without blocking in Several things at a time.

...R