// ------------------- ENUMERACIONES Y VARIABLES -------------------
enum EstadoElevador {
IDLE,
CERRANDO_PUERTAS,
MOVIENDO,
ABRIENDO_PUERTAS,
PUERTAS_ABIERTAS
};
EstadoElevador estado = IDLE;
// PINES SENSOR ULTRASÓNICO
const int trig = 2;
const int echoPin = 3;
unsigned long duracion;
int distancia;
// PINES LEDS DE PISO
const int ledPiso1 = 4;
const int ledPiso2 = 5;
const int ledPiso3 = 6;
// PINES PUENTE H (cabina y puertas)
const int ln1 = 7; // Motor cabina
const int ln2 = 8;
const int ln3 = 9; // Motor puertas
const int ln4 = 10;
const int ena = 11;
const int enb = 12;
// PINES BOTONES (INPUT_PULLUP) Y VARIABLES DE ANTIRREBOTE