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.
- Carte
- Nano 33 BLE · Arduino
- Difficulté
- Difficile
- Thème
- Timing & Program Flow
- Accès
- Offre complète
La tâche
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.
Voici le début de la tâche. Connectez-vous avec l'offre complète pour lire la suite et la résoudre.
Ce que vous obtenez
- Votre firmware est compilé et exécuté sur une carte émulée, puis vérifié par des tests matériels.
- Une explication écrite de la solution.
- Aucune carte de développement ni toolchain locale requise.
Débutant en embarqué ? Commencez par la feuille de route : Apprendre les systèmes embarqués (en anglais)