States and Watchdog

Created by Miroslav Biňas / mirek

## Annoucements
## Once Upon a Time...
![Blue Screen of Death](images/bsod.png) notes: * https://en.wikipedia.org/wiki/Blue_screen_of_death#/media/File:Windows_9X_BSOD.png
![Blue Screen of Death on ATM](images/bsod.on.atm.jpg) notes: * https://www.flickr.com/photos/tony_wasserman/3484632244
> **BSoD** is an error screen displayed on a Windows computer system following a **fatal system error**. It indicates a system crash, in which the **OS has reached a condition where it can no longer operate safely**. ([Wikipedia](https://en.wikipedia.org/wiki/Blue_screen_of_death))
> A **state machine** is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some inputs; the change from one state to another is called a transition. An FSM is defined by a list of its states, its initial state, and the inputs that trigger each transition. ([Wikipedia](https://en.wikipedia.org/wiki/Finite-state_machine))
## State Diagram
## Components of State Diagram * states * transitions * initial state * final state
![Turnstille at Toilet](images/turnstille.jpg)
![State Diagram of Turnstile](images/state.machine-turnstile.svg)
## State Design Pattern
![State Diagram Representing Game Actor [@Nystrom2014]](images/state-flowchart.png)
![Watchdog](images/watchdog.png) notes: * https://www.uihere.com/free-cliparts/french-bulldog-pit-bull-clip-art-watchdog-5810491
> Anything that can go wrong will go wrong. ([Murphy's Law](https://en.wikipedia.org/wiki/Murphy%27s_law))
> A **power-on self-test** (POST) is a diagnostic process performed by firmware or software routines **immediately after** a computer or other digital electronic device **is powered on** or **restarted**. ([Wikipedia](https://en.wikipedia.org/wiki/Power-on_self-test))
## Diagnostics
> Process of identifying, analyzing, and determining the cause or nature of problems or issues within a system, device, or situation. > ([Chat GPT](https://chat.openai.com))
![](images/car.dashboard.png)
![](images/check.engine.gif)
## How to Write Self-Tests for IoT Devices?
## Healthcheck
## Questions?