---
title: "#36 State Machines Part-2: Guard conditions"
url: https://daily.dev/posts/36-state-machines-part-2-guard-conditions-ol97vichz
source_url: https://www.youtube.com/watch?v=RGQRllvrMyY
type: video:youtube
source: "Quantum Leaps"
published: 2026-05-31T07:45:37.120Z
updated: 2026-05-31T08:43:55.805Z
tags: ["c", "embedded"]
reading_time: 14
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# #36 State Machines Part-2: Guard conditions

**[Quantum Leaps](https://daily.dev/sources/quantum-leaps)** · 14 min read · 0 upvotes · 0 comments

## Summary

Part 2 of a Modern Embedded Systems Programming course covering guard conditions and choice pseudostates in UML state machines. Using a TimeBomb application on a TivaC LaunchPad as a practical example, the lesson demonstrates how guard conditions (boolean expressions evaluated at runtime) add flexibility to state machines when behavior depends on runtime values unknown at design time. The implementation uses a blink_counter variable with a choice pseudostate to decide whether to continue blinking or trigger the 'boom' state. Code is implemented manually in C using nested switch statements. The lesson also warns against overusing guard conditions, as excessive use leads back to spaghetti code.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=RGQRllvrMyY>

---

Tags: [#c](https://daily.dev/tags/c), [#embedded](https://daily.dev/tags/embedded)

[View this post on daily.dev](https://daily.dev/posts/36-state-machines-part-2-guard-conditions-ol97vichz)
