Three-Floor Elevator Controller
On an Arduino Nano 33 BLE, control a small three-floor lift: remember floor calls, keep the car's direction and stop at called floors on the way, time the travel and the door, and drive the indicator panel lamps correctly.
- Placa
- Nano 33 BLE · Arduino
- Dificultad
- Difícil
- Tema
- Timing & Program Flow
- Acceso
- Plan completo
La tarea
Three-Floor Elevator Controller
A shop on three floors installs a small goods lift. Staff call it with one button per floor. A naive controller serves calls in the order they were pressed and makes the car shuttle past floors where someone is waiting. This one must work like a real lift: keep going in its direction and stop on the way. Times are shortened for the bench, and this is a programming exercise on an emulated board, not a certified lift controller.
Hardware
- Arduino Nano 33 BLE (nRF52840, 3.3 V logic). Serial console on
Serial1(D0/D1), 115200 baud.Serialis USB and is not seen by the tests. - Call buttons for floors 1, 2, 3 on D2, D3, D5, each to GND. Use the internal pull-ups (
LOW= pressed). A press counts once, after 20 ms without a break, however long the button is held. - Lift indicator panel (lamps with resistors on board,
HIGH= on): floor lamps F1 on D4, F2 on D6, F3 on D8; UP arrow on D9, DOWN arrow on D10; DOOR lamp (door open) on D11. - The car takes 500 ms to move one floor. The door stays open for 700 ms.
Write the sketch in sketch/sketch.ino. In setup() open Serial1 at 115200 baud, set up the pins and the start-up lamps, then print READY. Never block with delay(): calls can come at any moment.
Este es el inicio de la tarea. Inicia sesión con el plan completo para leer el resto y resolverla.
Qué incluye
- Tu firmware se compila y ejecuta en una placa emulada y se comprueba con pruebas a nivel de hardware.
- Una explicación escrita de la solución.
- No necesitas placa de desarrollo ni toolchain local.
¿Nuevo en embebidos? Empieza por la hoja de ruta: Cómo aprender sistemas embebidos (en inglés)