Помогите начинающему!!!

Тема в разделе "Arduino & Shields", создана пользователем free_nor, 4 апр 2014.

  1. free_nor

    free_nor Нерд

    Привет Всем! Помогите разобраться с проблемой в коде .Не проходит компиляцию выдает вот это
    sketch_apr04a:23: error: 'Bounce' does not name a type
    Ниже сам скетч! заранее спасибо всем !

    Код (Text):
    /*
    LCD screen for motorized camera dolly
    Code written by: Philip Sorri
    */
    #include <LiquidCrystal.h> //LCD library
    #include <Bounce.h> //debounce library
    int button3 = 6; //button pins
    int button2 = 7;
    int button1 = 8;
    int startStop = 9;
    int runTime1;
    int show = 1;    //what menu to show
    int dollySpeedNum = 0; //number of the speed
    int delayTime = 100; //delay after pressedbutton (see the functions)
    int delayDolly = 0; //delay before running
    int runTime = 0;    //time to run after delay
    int motorPin = 10;
    int val4;
    int shutter = 1;
    int shutterCount = 0;
    int shutterVal = 0;
    Bounce bouncer1 = Bounce(button1, 15); //deblounce (button, milliseconds)
    Bounce bouncer2 = Bounce(button2, 15);
    Bounce bouncer3 = Bounce(button3, 15);
    Bounce bouncer4 = Bounce(startStop, 15);
    LiquidCrystal lcd(12,11,5,4,3,2); //pins of the LCD to arduino
    void setup() {
      pinMode(button1, INPUT); //button as inputs
      pinMode(button2, INPUT);
      pinMode(button3, INPUT);
      pinMode(startStop, INPUT);
      pinMode(motorPin, OUTPUT);
      pinMode(shutter, OUTPUT);
      lcd.begin(16,2);
      lcd.setCursor(0,0);
      lcd.print("DOLLYDUINO V 1.1");
      lcd.setCursor(0,1);
      lcd.print("By ThePhilleBoy");
      delay(3000);
    }
    void loop() {
      if(shutterVal > 1) {
        shutterVal = 0;
      }
      runTime1 = runTime;
      if(runTime == 0) {
        runTime1 = 10;
      }
      else {
        runTime1 = runTime;
      }
      bouncer1.update();  //update the buttons
      bouncer2.update();
      bouncer3.update();
      bouncer4.update();
      int val1 = bouncer1.read(); //reads the value
      int val2 = bouncer2.read(); //and sets the new variables to it
      int val3 = bouncer3.read(); //So if button is pressed value = HIGH
      val4 = bouncer4.read();
      if (show > 4) {              //Number of menus
        show = 1;
      }
      if(val3 == HIGH) {    //scroll through the different menus
        show = show + 1;    //the show number indicates which menu we're in
        delay(delayTime * 5);
      }
      if(show == 1) {      //if show is 1 the dollySpeed function is chosen/shown
        dollySpeed(val1, val2);  //To change values in this menu with same buttons
      }                          //in all the menus
      else if(show == 2) {  //if show is 2 delay function is chosen/shown on LCD
        dollyDelay(val1, val2);
      }
      else if(show == 3) {
        runningTime(val1, val2);
      }
      else if(show == 4) { //shows all the setting that are chosen
        settings();
        if(val1 == HIGH || val2 == HIGH) {
          shutterVal = shutterVal + 1;
          delay(delayTime*3);
        }
      }
      if(val4 == HIGH && shutterVal == 0){
      motorOn();
    }
      if(val4 == LOW){
      analogWrite(motorPin, LOW);
    }
      if(val4 == HIGH && shutterVal == 1) {
      motorOn();
      lcd.setCursor(0,0);
      lcd.print("P:");
      lcd.setCursor(4,0);
      lcd.print(shutterCount);
    }
    }
    void dollySpeed(int num1, int num2) {
      lcd.setCursor(0,0);    //sets the startpoint of the text to (0,0)
      lcd.print("Dolly speed:    "); //Writes "Dolly speed:" to the LCD
      if(num1 == HIGH) { //if num1 which is val1/button1 is pressed the speed
        dollySpeedNum = dollySpeedNum + 1;  //increases with 1
        delay(delayTime);      //delay before next press, otherwise it would
      }                        //scroll fast as hell
      if(num2 == HIGH) {        //if button2 is pressed decrease with 1
        dollySpeedNum = dollySpeedNum - 1;
        delay(delayTime);
      }
      lcd.setCursor(0,1);  //sets the starting point of the print
      lcd.print(dollySpeedNum); //prints to the start point (0,1)
      if(dollySpeedNum < 10) {
        lcd.setCursor(1, 1);
        lcd.print("%            "); //makes a percent sign after the number
      }                      //the space after it is to hide numbers that might
      if(dollySpeedNum >= 10 && dollySpeedNum < 100) { //be shown from the last
        lcd.setCursor(2, 1);            //menu that we scrolled from.
        lcd.print("%      "); //if the speed if over 10 and less than 100 it moves
      }                        //the percentsign one step to the right.
      if(dollySpeedNum == 100) { //same here
        lcd.setCursor(3, 1);
        lcd.print("%      ");
      }
      if(dollySpeedNum > 100) { //I wanted the speed to be in percent so I
        dollySpeedNum = 0;      //have to limit the value of dollySpeedNum.
      }                        //if the value is higher than 100 it makes it to 0
      if(dollySpeedNum < 0) {  //and if it's lower than 0 it goes to 100.
        dollySpeedNum = 100;
      }
    }
    void dollyDelay(int but1, int but2) {
      int decimal;
      decimal = delayDolly%10;
      lcd.setCursor(0,0);
      lcd.print("Delay:          ");
      if(but1 == HIGH) {
        delayDolly = delayDolly + 1;
        delay(delayTime);
      }
      if(but2 == HIGH) {
        delayDolly = delayDolly - 1;
        delay(delayTime);
      }
      lcd.setCursor(0,1);
      lcd.print(delayDolly/10);
      if(delayDolly < 10) {
        lcd.setCursor(1, 1);
        lcd.print(".");
        lcd.setCursor(2,1);
        lcd.print(decimal);
        lcd.setCursor(3,1);
        lcd.print(" s    ");
      }
      if(delayDolly >= 10 && delayDolly < 100) {
        lcd.setCursor(1, 1);
        lcd.print(".");
        lcd.setCursor(2,1);
        lcd.print(decimal);
        lcd.setCursor(3,1);
        lcd.print(" s    ");
      }
      if(delayDolly > 99) {
        lcd.setCursor(2, 1);
        lcd.print(".");
        lcd.setCursor(3,1);
        lcd.print(decimal);
        lcd.setCursor(4,1);
        lcd.print(" s    ");
      }
      if(delayDolly > 999) {
        delayDolly = 0;
      }
      if(delayDolly < 0) {
        delayDolly = 999;
      }
    }
    void runningTime(int num1, int num2) {
      int decimal1;
      decimal1 = runTime%10;
      lcd.setCursor(0,0);
      lcd.print("Run time:      ");
      if(num1 == HIGH) {
        runTime = runTime + 1;
        delay(delayTime);
      }
      if(num2 == HIGH) {
        runTime = runTime - 1;
        delay(delayTime);
      }
      lcd.setCursor(0,1);
      lcd.print(runTime/10);
      if(runTime < 10) {
        lcd.setCursor(1, 1);
        lcd.print(".");
        lcd.setCursor(2,1);
        lcd.print(decimal1);
        lcd.setCursor(3,1);
        lcd.print(" s    ");
      }
      if(runTime >= 10 && runTime < 100) {
        lcd.setCursor(1, 1);
        lcd.print(".");
        lcd.setCursor(2,1);
        lcd.print(decimal1);
        lcd.setCursor(3,1);
        lcd.print(" s    ");
      }
      if(runTime > 99) {
        lcd.setCursor(2, 1);
        lcd.print(".");
        lcd.setCursor(3,1);
        lcd.print(decimal1);
        lcd.setCursor(4,1);
        lcd.print(" s    ");
      }
      if(runTime > 999) {
        runTime = 0;
      }
      if(runTime < 0) {
        runTime = 999;
      }
    }
    void settings() {
      int decimal1;
      int decimal2;
      decimal1 = runTime%10;
      decimal2 = delayTime%10;
      lcd.setCursor(0,0);
      lcd.print("S: ");
      lcd.setCursor(3,0);
      lcd.print(dollySpeedNum);
      if(dollySpeedNum < 10) {
        lcd.setCursor(4,0);
        lcd.print("%  ");
      }
      if(dollySpeedNum >= 10 && dollySpeedNum < 100) {
        lcd.setCursor(5,0);
        lcd.print("%  ");
      }
      if(dollySpeedNum == 100) {
        lcd.setCursor(6,0);
        lcd.print("% ");
      }
      lcd.setCursor(8,0);
      lcd.print("R: ");
      lcd.setCursor(11,0);
      lcd.print(runTime/10);
      if(runTime < 10) {
        lcd.setCursor(12, 0);
        lcd.print(".");
        lcd.setCursor(13,0);
        lcd.print(decimal1);
        lcd.setCursor(14,0);
        lcd.print("s");
      }
      if(runTime >= 10 && runTime < 100) {
        lcd.setCursor(12,0);
        lcd.print(".");
        lcd.setCursor(13,0);
        lcd.print(decimal1);
        lcd.setCursor(14,0);
        lcd.print("s");
      }
      if(runTime > 99) {
        lcd.setCursor(13,0);
        lcd.print(".");
        lcd.setCursor(14,0);
        lcd.print(decimal1);
        lcd.setCursor(15,0);
        lcd.print("s");
    }
    lcd.setCursor(0,1);
      lcd.print("D: ");
      lcd.setCursor(3,1);
      lcd.print(delayDolly/10);
      if(delayDolly < 10) {
        lcd.setCursor(4, 1);
        lcd.print(".");
        lcd.setCursor(5,1);
        lcd.print(decimal1);
        lcd.setCursor(6,1);
        lcd.print("s");
      }
      if(delayDolly >= 10 && delayDolly < 100) {
        lcd.setCursor(4,1);
        lcd.print(".");
        lcd.setCursor(5,1);
        lcd.print(decimal2);
        lcd.setCursor(6,1);
        lcd.print("s");
      }
      if(delayDolly > 99) {
        lcd.setCursor(5, 1);
        lcd.print(".");
        lcd.setCursor(6,1);
        lcd.print(decimal1);
        lcd.setCursor(7,1);
        lcd.print("s");
    }
    if(val4 == LOW) {
    if(shutterVal == 0) {
    lcd.setCursor(10,1);
    lcd.print("I=OFF");
    }
    if(shutterVal == 1) {
      lcd.setCursor(10,1);
      lcd.print("I=ON ");
    }
    }
    }
    void motorOn () {
      int speedValue = map(dollySpeedNum, 0, 100, 0, 255);
      analogWrite(motorPin, speedValue);
        delay(runTime1*100);
        if(delayDolly > 0) {
        analogWrite(motorPin, LOW);
        picture();
        shutterCount = shutterCount + 1;
        delay(delayDolly*100);
      }
    }
    void picture() {
      pinMode(shutter, HIGH);
      delay(50);
      pinMode(shutter, LOW);
    }
     
  2. Megakoteyka

    Megakoteyka Оракул Модератор

    Библиотеку забыли положить.
     
  3. free_nor

    free_nor Нерд

    эту? #include <Bounce.h>
     
  4. да, в папку libraries
     
  5. free_nor

    free_nor Нерд

    Дело в том что она та там и есть ... лежит и радуется .. а работать скетч не хочет
     
  6. free_nor

    free_nor Нерд

    Скажите, а может ли быть дело в том что вышла новая библиотека Bounce и из -за этого она не работает на этом скетче ?
     
  7. может что путь до библиотеки не правильный
     
  8. free_nor

    free_nor Нерд

    другие же библиотеки работаю без проблем
     
  9. ИгорьК

    ИгорьК Гуру

    'Bounce' does not name a type
    1. переводим: 'Bounce' - это не имя типа данных.
    2. находим строку, которая делает что? : "Bounce bouncer1 = Bounce(button1, 15); " - объявляет bouncer1 типом Bounce.
    3. Вывод - мы не "достигаем" библиотеки <Bounce.h> по какой-то причине, либо в ней ошибка. И не важно, что другие библиотеки работают.
    Что можно сделать.
    1. Найти эту библиотеку и переписать ее заново в папку.
    Если это не помогает - в библиотеке ошибка. Выход "прост":
    2. Забить на нее и писать код с проверкой антидребезга - примеров в инете хватает.
    3. Искать ошибку в библиотеке. Но проще пункт 2.
     
    Последнее редактирование: 4 апр 2014
  10. free_nor

    free_nor Нерд

    Спасибо за ответы . будем писать по антидребезгу:)
     
  11. lerik2703

    lerik2703 Гик

    14.JPG

    у вас Ардуинка не с похожим окошком запускаться?
     
  12. free_nor

    free_nor Нерд

    я конечно только начал работать с ардуино но читать умею слава богу .. там же все написано ... Вообщем решил я проблему с библиотекой Bounce нашел тут на форуме добрый человек выложил она сразу заработала а вот с обновленой с офф сайта работать почему то не хочет ... .вообщем выкладываю вдруг у кого то же такое случиться .... еще раз всем спасибо кто откликнулся:):) библиотека ниже:)
     

    Вложения:

    • Bounce.zip
      Размер файла:
      13,6 КБ
      Просмотров:
      311
    Megakoteyka нравится это.
  13. ИгорьК

    ИгорьК Гуру

    Коллеги! А зачем вообще весь этот огород с библиотекой, если можно писать так:
    Код (Text):
    if (digitalRead(12) == 0) {                // Стандартная проверка с антидребезгом;
        delay(20);                             // Ждем для устранения дребезга;
        if (digitalRead(12) == 0) {            // Проверяем еще раз;
            do...        
        }
    }
     
    Последнее редактирование: 6 апр 2014
  14. Megakoteyka

    Megakoteyka Оракул Модератор

    Все же 20 мс - иногда немало. В идеале нужно дребезг аппаратно снимать и не мучать контроллер.
     
  15. lerik2703

    lerik2703 Гик

    дело не в умении читать ,а в том что большинство новичков зачастую просто игнорируют похожие сообщения !с оф сайта библиотека рабочая только 2-я версия!(Bounce2.h)
     
  16. free_nor

    free_nor Нерд

    к сожалению у меня по какой то причине работает только первая версия Bounce ... я выложил тут .. сейчас мучаюсь с кодом и пытаюсь переписать и меню и управления шаговым двигателем ... но к сожалению пока ничего не получается ...
     
  17. lerik2703

    lerik2703 Гик

    есть специальная библиотека <Stepper.h> чтоб не мучаться :) или по каким-то причинам она вам не подходит?
     
  18. free_nor

    free_nor Нерд

    Дело в том что ШД у меня подключен через Motor Shield... и по началу не мог заставить работать правильно ШД. Сейчас я добавил в код вот это :
    Код (Text):
    void motorOn () {
      motor.setSpeed (4); //скорость вращения Ш.двигателя 4 оборота в минуту
      motor.release(); //отключение питания Ш.двигателя для установки ракурса первого снимка

      int speedValue = map(dollySpeedNum,200, 100, 50, 4);
      analogWrite(motorPin, speedValue);
        delay(runTime1*100);
        if(delayDolly > 0) {
        analogWrite(motorPin, LOW);
        motor.step(speedValue, BACKWARD, INTERLEAVE);
        picture();
        shutterCount = shutterCount + 1;
        delay(delayDolly*100);
      }

    ШД стал откликаться и работать .. но не так как нужно ... причина я думаю в том что неправильно прописан алгоритм работы двигателя и неправильно понимаются величины которые задаются через меню кторое тут есть ....и пока что я в тупике ...и не знаю даже как правильно исправить ...








    Код (Text):
    /*
    LCD screen for motorized camera dolly
    Code written by: Philip Sorri
    */

    #include <AFMotor.h>
    #include <LiquidCrystal.h> //LCD library
    #include <Bounce.h> //debounce library
    int button3 = A5; //button pins
    int button2 =A4;
    int button1 = A3;
    int startStop = A2;
    int runTime1;
    int show = 1;    //what menu to show
    int dollySpeedNum = 0; //number of the speed
    int delayTime = 100; //delay after pressedbutton (see the functions)
    int delayDolly = 0; //delay before running
    int runTime = 0;    //time to run after delay
    int motorPin = 10;
    int angle=200*22/360; //задание числа шагов Ш.двигателя на один кадр, используемый Ш.двигатель совершает 200 шагов на полный оборот
    int panstep=1500; //задание числа снимков
    int shotPin=0; //определение контакта управления съемкой через USB
    int pause=1000; //определение паузы для процесса съемки
    int shot=0; //определение длительности сигнала USB 5В управления съемкой
    AF_Stepper motor(200, 1);
    int val4;
    int shutter = 1;
    int shutterCount = 0;
    int shutterVal = 0;
    Bounce bouncer1 = Bounce(button1, 15); //deblounce (button, milliseconds)
    Bounce bouncer2 = Bounce(button2, 15);
    Bounce bouncer3 = Bounce(button3, 15);
    Bounce bouncer4 = Bounce(startStop, 15);
    LiquidCrystal lcd(4, 5, 10, 11, 12, 13); //pins of the LCD to arduino
    void setup() {
      pinMode(button1, INPUT); //button as inputs
      pinMode(button2, INPUT);
      pinMode(button3, INPUT);
      pinMode(startStop, INPUT);
      pinMode(motorPin, OUTPUT);
      pinMode(shutter, OUTPUT);
      lcd.begin(16,2);
      lcd.setCursor(0,0);
      lcd.print("DOLLYDUINO V 1.1");
      lcd.setCursor(0,1);
      lcd.print("By ThePhilleBoy");
      delay(3000);
    }
    void loop() {
      if(shutterVal > 1) {
        shutterVal = 0;
      }
      runTime1 = runTime;
      if(runTime == 0) {
        runTime1 = 10;
      }
      else {
        runTime1 = runTime;
      }
      bouncer1.update();  //update the buttons
      bouncer2.update();
      bouncer3.update();
      bouncer4.update();
      int val1 = bouncer1.read(); //reads the value
      int val2 = bouncer2.read(); //and sets the new variables to it
      int val3 = bouncer3.read(); //So if button is pressed value = HIGH
      val4 = bouncer4.read();
      if (show > 4) {              //Number of menus
        show = 1;
      }
      if(val3 == HIGH) {    //scroll through the different menus
        show = show + 1;    //the show number indicates which menu we're in
        delay(delayTime * 5);
      }
      if(show == 1) {      //if show is 1 the dollySpeed function is chosen/shown
        dollySpeed(val1, val2);  //To change values in this menu with same buttons
      }                          //in all the menus
      else if(show == 2) {  //if show is 2 delay function is chosen/shown on LCD
        dollyDelay(val1, val2);
      }
      else if(show == 3) {
        runningTime(val1, val2);
      }
      else if(show == 4) { //shows all the setting that are chosen
        settings();
        if(val1 == HIGH || val2 == HIGH) {
          shutterVal = shutterVal + 1;
          delay(delayTime*3);
        }
      }
      if(val4 == HIGH && shutterVal == 0){
      motorOn();
    }
      if(val4 == LOW){
      analogWrite(motorPin, LOW);
    }
      if(val4 == HIGH && shutterVal == 1) {
      motorOn();
      lcd.setCursor(0,0);
      lcd.print("P:");
      lcd.setCursor(4,0);
      lcd.print(shutterCount);
    }
    }
    void dollySpeed(int num1, int num2) {
      lcd.setCursor(0,0);    //sets the startpoint of the text to (0,0)
      lcd.print("SPEED:    "); //Writes "Dolly speed:" to the LCD
      if(num1 == HIGH) { //if num1 which is val1/button1 is pressed the speed
        dollySpeedNum = dollySpeedNum + 1;  //increases with 1
        delay(delayTime);      //delay before next press, otherwise it would
      }                        //scroll fast as hell
      if(num2 == HIGH) {        //if button2 is pressed decrease with 1
        dollySpeedNum = dollySpeedNum - 1;
        delay(delayTime);
      }
      lcd.setCursor(0,1);  //sets the starting point of the print
      lcd.print(dollySpeedNum); //prints to the start point (0,1)
      if(dollySpeedNum < 10) {
        lcd.setCursor(1, 1);
        lcd.print("%            "); //makes a percent sign after the number
      }                      //the space after it is to hide numbers that might
      if(dollySpeedNum >= 10 && dollySpeedNum < 100) { //be shown from the last
        lcd.setCursor(2, 1);            //menu that we scrolled from.
        lcd.print("%      "); //if the speed if over 10 and less than 100 it moves
      }                        //the percentsign one step to the right.
      if(dollySpeedNum == 100) { //same here
        lcd.setCursor(3, 1);
        lcd.print("%      ");
      }
      if(dollySpeedNum > 100) { //I wanted the speed to be in percent so I
        dollySpeedNum = 0;      //have to limit the value of dollySpeedNum.
      }                        //if the value is higher than 100 it makes it to 0
      if(dollySpeedNum < 0) {  //and if it's lower than 0 it goes to 100.
        dollySpeedNum = 100;
      }
    }
    void dollyDelay(int but1, int but2) {
      int decimal;
      decimal = delayDolly%10;
      lcd.setCursor(0,0);
      lcd.print("Delay:          ");
      if(but1 == HIGH) {
        delayDolly = delayDolly + 1;
        delay(delayTime);
      }
      if(but2 == HIGH) {
        delayDolly = delayDolly - 1;
        delay(delayTime);
      }
      lcd.setCursor(0,1);
      lcd.print(delayDolly/10);
      if(delayDolly < 10) {
        lcd.setCursor(1, 1);
        lcd.print(".");
        lcd.setCursor(2,1);
        lcd.print(decimal);
        lcd.setCursor(3,1);
        lcd.print(" s    ");
      }
      if(delayDolly >= 10 && delayDolly < 100) {
        lcd.setCursor(1, 1);
        lcd.print(".");
        lcd.setCursor(2,1);
        lcd.print(decimal);
        lcd.setCursor(3,1);
        lcd.print(" s    ");
      }
      if(delayDolly > 99) {
        lcd.setCursor(2, 1);
        lcd.print(".");
        lcd.setCursor(3,1);
        lcd.print(decimal);
        lcd.setCursor(4,1);
        lcd.print(" s    ");
      }
      if(delayDolly > 999) {
        delayDolly = 0;
      }
      if(delayDolly < 0) {
        delayDolly = 999;
      }
    }
    void runningTime(int num1, int num2) {
      int decimal1;
      decimal1 = runTime%10;
      lcd.setCursor(0,0);
      lcd.print("Run time:      ");
      if(num1 == HIGH) {
        runTime = runTime + 1;
        delay(delayTime);
      }
      if(num2 == HIGH) {
        runTime = runTime - 1;
        delay(delayTime);
      }
      lcd.setCursor(0,1);
      lcd.print(runTime/10);
      if(runTime < 10) {
        lcd.setCursor(1, 1);
        lcd.print(".");
        lcd.setCursor(2,1);
        lcd.print(decimal1);
        lcd.setCursor(3,1);
        lcd.print(" s    ");
      }
      if(runTime >= 10 && runTime < 100) {
        lcd.setCursor(1, 1);
        lcd.print(".");
        lcd.setCursor(2,1);
        lcd.print(decimal1);
        lcd.setCursor(3,1);
        lcd.print(" s    ");
      }
      if(runTime > 99) {
        lcd.setCursor(2, 1);
        lcd.print(".");
        lcd.setCursor(3,1);
        lcd.print(decimal1);
        lcd.setCursor(4,1);
        lcd.print(" s    ");
      }
      if(runTime > 999) {
        runTime = 0;
      }
      if(runTime < 0) {
        runTime = 999;
      }
    }
    void settings() {
      int decimal1;
      int decimal2;
      decimal1 = runTime%10;
      decimal2 = delayTime%10;
      lcd.setCursor(0,0);
      lcd.print("S: ");
      lcd.setCursor(3,0);
      lcd.print(dollySpeedNum);
      if(dollySpeedNum < 10) {
        lcd.setCursor(4,0);
        lcd.print("%  ");
      }
      if(dollySpeedNum >= 10 && dollySpeedNum < 100) {
        lcd.setCursor(5,0);
        lcd.print("%  ");
      }
      if(dollySpeedNum == 100) {
        lcd.setCursor(6,0);
        lcd.print("% ");
      }
      lcd.setCursor(8,0);
      lcd.print("R: ");
      lcd.setCursor(11,0);
      lcd.print(runTime/10);
      if(runTime < 10) {
        lcd.setCursor(12, 0);
        lcd.print(".");
        lcd.setCursor(13,0);
        lcd.print(decimal1);
        lcd.setCursor(14,0);
        lcd.print("s");
      }
      if(runTime >= 10 && runTime < 100) {
        lcd.setCursor(12,0);
        lcd.print(".");
        lcd.setCursor(13,0);
        lcd.print(decimal1);
        lcd.setCursor(14,0);
        lcd.print("s");
      }
      if(runTime > 99) {
        lcd.setCursor(13,0);
        lcd.print(".");
        lcd.setCursor(14,0);
        lcd.print(decimal1);
        lcd.setCursor(15,0);
        lcd.print("s");
    }
    lcd.setCursor(0,1);
      lcd.print("D: ");
      lcd.setCursor(3,1);
      lcd.print(delayDolly/10);
      if(delayDolly < 10) {
        lcd.setCursor(4, 1);
        lcd.print(".");
        lcd.setCursor(5,1);
        lcd.print(decimal1);
        lcd.setCursor(6,1);
        lcd.print("s");
      }
      if(delayDolly >= 10 && delayDolly < 100) {
        lcd.setCursor(4,1);
        lcd.print(".");
        lcd.setCursor(5,1);
        lcd.print(decimal2);
        lcd.setCursor(6,1);
        lcd.print("s");
      }
      if(delayDolly > 99) {
        lcd.setCursor(5, 1);
        lcd.print(".");
        lcd.setCursor(6,1);
        lcd.print(decimal1);
        lcd.setCursor(7,1);
        lcd.print("s");
    }
    if(val4 == LOW) {
    if(shutterVal == 0) {
    lcd.setCursor(10,1);
    lcd.print("I=OFF");
    }
    if(shutterVal == 1) {
      lcd.setCursor(10,1);
      lcd.print("I=ON ");
    }
    }
    }
    void motorOn () {
      motor.setSpeed (4); //скорость вращения Ш.двигателя 4 оборота в минуту
      motor.release(); //отключение питания Ш.двигателя для установки ракурса первого снимка

      int speedValue = map(dollySpeedNum,200, 100, 50, 4);
      analogWrite(motorPin, speedValue);
        delay(runTime1*100);
        if(delayDolly > 0) {
        analogWrite(motorPin, LOW);
        motor.step(speedValue, BACKWARD, INTERLEAVE);
        picture();
        shutterCount = shutterCount + 1;
        delay(delayDolly*100);
      }
    }
    void picture() {
      pinMode(shutter, HIGH);
      delay(50);
      pinMode(shutter, LOW);
    }