Sliding Door with Arduino, Bluetooth and Servo Motor

I am doing a project for the school in which I have to make a sliding door open or close using 2 buttons in an application with bluetooth, but I can't make the motor move when I press the buttons in the application there is no error on the screen, it just doesn't work, I leave the code below:

#include <SoftwareSerial.h>
#include <Servo.h>
int mover;
int mover2;
int pinBluetoothTX=10;
int pinBluetoothRX=11;
Servo servoMotor1;
Servo servoMotor2;
char rxChar;
SoftwareSerial bluetooth(pinBluetoothTX, pinBluetoothRX);
void setup(){
  Serial.begin(9600);
pinMode (4,INPUT);//Fin de carrera 1
pinMode (2,INPUT);//Fin de carrera 2
mover=120; //0 Abrir 180 Cerrar 60-120 Velocidades
mover2=150;//motor Cerradura
servoMotor1.attach(8);//Motor Pin8
servoMotor2.attach(9);//Motor Pin9
bluetooth.begin(9600);
}
void loop() {
 int lectura; 
 int lectura2;
  servoMotor1.write(mover);
  servoMotor2.write(mover2);
  lectura=digitalRead(4);//fin de carrera
  lectura2=digitalRead(2);//fin de carrera
   if (bluetooth.available()>0){
    rxChar=bluetooth.read();
    Serial.println(rxChar); 
   }
   if(rxChar=='1'){
   Serial.println("60 Grados");
   mover=60;
   }
   if(rxChar=='2'){
   Serial.println("120 Grados");
   mover=120;
   }
  if (lectura==LOW and mover==60){
    mover=90;//motor frena
    
  }
  if (lectura2==LOW and mover==120){
    mover=90;//motor frena
    mover2=30;//Motor Cerradura Cerrado
  }
  }

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.