A deep dive into input-driven state machines for embedded software, tracing their origins from Mealy and Moore hardware state machines in the 1950s. Explains how hardware concepts like synchronous circuits, truth tables, and state diagrams translate into software. Contrasts input-driven (polling) state machines with event-driven state machines, covering key differences in execution model, race condition risks, and input buffering. Includes hands-on coding on an Arduino-like board implementing a blinky+button state machine, demonstrating input buffering, guard conditions, and the spectrum from input-driven to fully event-driven designs. Discusses practical use cases for each approach including games, robotics, and debouncing.

31m watch time
1 Impression