5 · Communication & data
Detect a freeze (watchdog)
Expert22 min
Goal
Report when a reading has not been refreshed for 3 seconds.
Why it matters
A reliable system detects its own failures instead of showing stale data.
Steps
- 01Store the timestamp of the last valid reading.
- 02In loop(), compare millis() to that timestamp.
- 03Past 3000 ms, light the alert LED and report on the serial port.
This tutorial runs inside the Circuitly simulator: your wiring and your code are checked automatically at every step.
Next tutorials
- Control the board from the keyboard
Switch the LED on/off with the “on” and “off” commands.
- Log data as CSV
Produce “time;value” lines usable in a spreadsheet.
- Remember after power-off (EEPROM)
Keep a setting even after a restart.
- State machine
Structure a traffic light into explicit states (GREEN, AMBER, RED).