Skip to content
0:00 / 0:00

#statemachines#finitestatemachine#uml

#35 State Machines Part-1: What is a state machine?

Quantum Leaps, LLC

74K subscribers • 20 videos on Hallway

YouTube

Beginner. No background in the topic needed.

64K views5 years ago2 recommendations

Systems programmingSoftware designEmbedded systemsDesign patternsSoftware architecture

Miro Samek introduces the concepts of state and finite state machines, explaining how they prevent spaghetti code in event-driven systems.

This lesson starts a new segment about STATE MACHINES. The lesson starts with the biggest challenge of event-driven programming, which is preserving the context from one event to the next. You'll see how the usual improvised context management leads to "spaghetti code". Next, you'll see a different approach, in which you capture only the "relevant history" of the system and how this leads to the concepts of "State" and "State Machine". You'll also learn the basic elements of state diagrams, and you'll see how to design a state machine diagram for the "Blinky-Button" example. Finally, you'll see how state machines complement the Active-Object design pattern, and you go through the experience of coding a state machine in C. ------- Resources: Companion web page for this video course: state-machine.com/quickstart GitHub repository for projects for this video course: github.com/QuantumLeaps/modern-embedded-programming-course Freeware QM modeling tool download: github.com/QuantumLeaps/qm/releases Transcript of this lesson: state-machine.com/course/lesson35.txt Music credits: The background music comes from: bensound.com/royalty-free-music/track/straight

Why it's here

2 people recommend this

What people say. Recommended as an excellent starting point for learning finite state machines in embedded software design.

u/Farad_747in r/embedded • Recommends

On “Beginner's guide for professional firmware development?”

I think that as soon as you increase complexity in terms of behavior, the de-facto 'Design Pattern' for embedded software is a Finite State Machine. Some books i can recommend you: * "Reusable Firmware development" J.Beningo * "Design Patterns for Embedded Systems in C" B.P.Douglass. I found this channel recently and it has amazing content too: * [video

u/active-objectin r/embedded • Recommends

On “State Machines in embedded?”

Here is the YouTube playlist that explains state machines in the context of embedded systems: * State Machines Part-1: What is a state machine? * State Machines Part-2: Guard conditions * State Machines Part-3: Input-Driven State Machines * State Machines Part-4: State Tables and Entry/Exit Actions * State Machines Part-5: Optimal Implementation in C * State Machines Part-6: What is a Hierarchical State Machine? * State Machines Part-7:Automatic Code Generation * State Machines Part-8: Semantics of Hierarchical State Machines