Need help in coding ,don't know where the error.

Hello. Need help in coding ,don’t know where the error:

#include <Servo.h>

unsigned long currentTime;
Servo myservo;
int ddt = 4;
int ddy = 3;
int ddu = 2;

void setup(){
  myservo.attach(9);
currentTime = millis();
  pinMode(ddt, INPUT);
  pinMode(ddy, INPUT);
  pinMode(ddu, INPUT);
myservo.write(20);
}
void loop(){
{
if (digitalRead(ddt) == HIGH)

myservo.write(100);
delay(1000);
currentTime = 2500;
myservo.write(20);
time1();}
{
if (digitalRead(ddy) == HIGH)

myservo.write(100);
delay(1000);
myservo.write(20);
time2();}
{
if (digitalRead(ddu) == HIGH)

myservo.write(100);
delay(1000);
myservo.write(20);
time3();
}


}

void time1()
{
currentTime = 2500;

}
void time2()
{
currentTime = 20000;
}
void time3()
{
currentTime = 10000;

}

this is the code for opening a window on a time-controlled servoy and switch on the 3rd position

Don't know why you are posting because you have not asked a question yet . I don't know what you are trying to do with your program because it doesn't make any sense. It has a bunch of statements that do nothing. (aside from the servoWrite statements)

what is the question?

(deleted)

here is a diagram in proteus:http://yadi.sk/d/SwY2sj8rQRpNb

All I could find was a lot of unnecessary braces in the code. For example, you have two opening braces for the loop() function where only one is needed. You also seem to set off every code block with braces where none is needed. You would also benefit from using standard C formatting for your code, which is easily done using Ctrl-T while in the IDE. After removing your unneeded braces, I got:

#include <Servo.h>

unsigned long currentTime;
Servo myservo;
int ddt = 4;
int ddy = 3;
int ddu = 2;

void setup() {
  myservo.attach(9);
  currentTime = millis();
  pinMode(ddt, INPUT);
  pinMode(ddy, INPUT);
  pinMode(ddu, INPUT);
  myservo.write(20);
}
void loop() {

    if (digitalRead(ddt) == HIGH) {
      myservo.write(100);
    }
    delay(1000);
    currentTime = 2500;
    myservo.write(20);
    time1();

    if (digitalRead(ddy) == HIGH) {
      myservo.write(100);
    }
    delay(1000);
    myservo.write(20);
    time2();

    if (digitalRead(ddu) == HIGH) {
      myservo.write(100);
    }
    delay(1000);
    myservo.write(20);
    time3();

}

void time1()
{
  currentTime = 2500;
}
void time2()
{
  currentTime = 20000;
}
void time3()
{
  currentTime = 10000;
}

which at least compiles.

no code is not,on any pause button is 2-3 seconds

what is the question?

That's my question. What is your question ?

http://yadi.sk/d/SwY2sj8rQRpNb What is this supposed to mean ?

no code is not,on any pause button is 2-3 seconds

And what does this mean ?

this is the code for opening a window on a time-controlled servoy and switch on the 3rd position

And what does this mean ? You need to speak English or use Google Translate. You are not making any sense .

raschemmel:

what is the question?

That's my question. What is your question ?

http://yadi.sk/d/SwY2sj8rQRpNb What is this supposed to mean ?

no code is not,on any pause button is 2-3 seconds

And what does this mean ?

this is the code for opening a window on a time-controlled servoy and switch on the 3rd position

And what does this mean ? You need to speak English or use Google Translate. You are not making any sense .

I translate from Google Translate

1) on the drive circuit Yandex device. 2) I tried the code that is corrected "econjack", the code does not work 3) A device to open the servo specified interval.