Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
You are viewing an older revision! See the latest version
Zustandsdiagramm
Ein Zustandsdiagramm (auch Zustandsmaschine, State Machine Diagram - kurz STM, Zustandsautomat, genannt) ist ein Graph mit Zuständen als Knoten und Zustandsübergängen als Kanten, die durch Ereignisse (Events) ausgelöst werden. In der Objektorientierung handelt es sich normalerweise um die Zustände eines Objekts einer gewissen Klasse.
Bulme PE Vereinbarungen für die Codierung:
Zustände (states) werden als Konstante oder Aufzählungstypen (enumerations) definiert:
// Constants const int ST_IDLE = 0; const int ST_NEXT = 1; // Declaration of variable state uint8_t state;
oder mit enum:
// Enumerations
enum nextstate {ST_IDLE, ST_NEXT};
// Declaration of variable state
nextstate state;
oder mit enum mit Type aliases (typedef)
// Enumerations with typedef
typedef enum {ST_EIN, ST_AUS, ST_STATE2, ST_STATE3} nextstate;
// Declaration of variable state
nextstate state;