Machine Event Log Ring Buffer
On an Arduino Nano 33 BLE, build a black-box recorder for a packaging machine: debounce jam and guard-door events, keep the 8 newest in a ring buffer with timestamps, dump them oldest first on request, and clear the log with a long press.
- Carte
- Nano 33 BLE · Arduino
- Difficulté
- Moyen
- Thème
- Data Handling & Algorithms
- Accès
- Offre complète
La tâche
Machine Event Log Ring Buffer
A cartoning machine on a packaging line sometimes stops for no clear reason. The maintenance team fits a small black-box recorder: it notes every jam sensor trip and every guard-door opening with a timestamp, keeps the most recent ones in a fixed amount of memory, and prints them for the technician on request.
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. - D2: jam sensor (event J), D3: guard-door switch (event G). Each closes to GND when its event happens. Use the internal pull-ups:
LOW= active. - D5: technician's DUMP button to GND,
LOW= pressed. - D4: LOG FULL lamp (LED with a series resistor to GND),
HIGH= on. - All three contacts bounce for a few milliseconds.
Write the sketch in sketch/sketch.ino. In setup() open Serial1 at 115200 baud, start with an empty log and the lamp off, then print READY. Never block with delay(): all three inputs are watched all the time.
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)